Translations of this page?:

Minor Bug, Perhaps you forgot to login?

When permission is denied to users who are logged in, says “Perhaps you forgot to login?”. This is distracting to the user who is logged in. It should give different messages for those who are logged in. Specifically, message says:

Sorry, you don't have enough rights to continue. Perhaps you forgot to login?

Internals

The text comes from the denied.txt file in ”inc/lang/*/denied.txt”. The English located in ”inc/lang/en/denied.txt”.

The code relevant to this is in:

  • inc/actions.php: line ~188, function act_permcheck($act) … retrun 'denied';
  • inc/template.php: line ~116, case 'denied': print p_locale_xhtml('denied');
  • inc/detail.php: line ~44, $ERROR = p_locale_xhtml('denied'); This is for image permissions

The Fix

The most efficient method is probably to have two “denied” files in each language:

  • denied.txt the current denied
  • denied_but_loggedin.txt the second denied file for whose who are logged in. Create this file and add text.

One or more of the below modified. But I'm not sure which since I am not as familiar with Dokuwiki.

  • inc/actions.php: line ~188, function act_permcheck($act) … retrun 'denied'; Probably not this one.
  • inc/template.php: line ~116, case 'denied': print p_locale_xhtml('denied');
  • inc/detail.php: line ~44, $ERROR = p_locale_xhtml('denied');

Quick hack … there may be better ways:

Creat the file inc/lang/*/denied_but_loggedin.txt, then open inc/template.php and change the folllowing code (~line 116) from:

    case 'denied':
	print p_locale_xhtml('denied');
	break;

Change To:

    case 'denied':
	  if($_SERVER['REMOTE_USER']){
                //You Must have created the file /inc/lang/*/denied_but_loggedin.txt for this to work.
		print p_locale_xhtml('denied_but_loggedin');  
		break;
	  }else {
		print p_locale_xhtml('denied');
		break;	  
	  }

Similar change can be done for image permission denied. Open lib/exe/details.php and change the folllowing code (~line 42) from:

else{
    // no auth
    $ERROR = p_locale_xhtml('denied');
  }
 

Change To:

  else{
    // no auth
        //You Must have created the file /inc/lang/*/denied_but_loggedin.txt for this to work.
	if ($_SERVER['REMOTE_USER']) { $ERROR = p_locale_xhtml('denied_but_loggedin'); }
	else { $ERROR = p_locale_xhtml('denied'); }
  }
 

Hope this works for you as it did for me.

Left to do

If you can think of something else we need to do, please FIXME

 
wiki/discussion/perhaps_you_forgot_to_login.txt · Last modified: 2006/10/15 03:40 by 72.25.87.91
 
Imprint Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate