00612: ?action=login doesn't work correct with [:if auth

Summary: ?action=login doesn't work correct with [:if auth
Created: 2005-12-02 08:52
Status: Closed - fixed for 2.1.beta11
Category: Bug
From: Klonk
Priority: 2
Version: 2.1beta9

Description: When I do an ?action=login then I'm asked for the password.

That's OK, but using (:if auth admin..... does not work. I assume that some variable has to be set or whatever. I have to manually do an ?action=edit (as it is writeprotected). Then I'm asked for the password and then everything is fine...

I don't understand what is meant by "(:if auth admin... does not work" -- what exactly isn't working about it?


Well quite simple: I do ?action=login and then I should normally see a change in my skin. I my skin I use the markup (:if auth edit:) to make some other stuff visible I can do with the page (e.g. edit links etc.). The strange thing is that when I use the following PHP code everything works fine:

 ##add login action
 SDV($HandleActions['login'], 'HandleLogin');
	$DefaultPasswords['LoginAction'] = ' ';
 function HandleLogin($pagename) {

I don't really now where the big difference is, but the above code works perfect.. Klonk

I think I need to see an example where it's not working -- ideally on a live site somewhere (even pmwiki.org would be fine). It's working fine for me in all of my tests. --Pm

Hm, very strange. Well I'm experimenting with skins based on my FlexiSkin?.

see http://www.loncarek.de/test for an example

On the top right side (below the search field) you'll something similar to a door. Click on it and then ?action=login is performed. The admin password is "test", edit password is "secret"

After successful login you should see more tabs and also some other icons instead of the door.

The page that holds the icons is:


the tabs are located in:


I hope this helps.


Actually, it seems to me that ?action=login isn't working on your site at all. After doing ?action=login with the auth password, I should be able to perform any action on the site without being prompted for the password again (e.g., ?action=attr). So, it looks as though the admin password isn't working at all for some reason.

Could you send me a copy of the config.php being used on the test site? And/or perhaps set $EnableDiag=1; ?



Here is the farmconfig.php:

<?php if (!defined('PmWiki')) exit();
 $WikiTitle = 'loncarek.de';

$ScriptUrl = ($_SERVER['HTTPS'] ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
$FarmPubDirUrl = ($_SERVER['HTTPS'] ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].'/pmwiki/pub';
$PubDirUrl = $FarmPubDirUrl;

 $EnablePathInfo = 1;

 $PageLogoUrl = "$PubDirUrl/loncarek.de.gif";

 $DiffAccessLevel = 'edit'; ## Seitenhistorie nur, wenn Bearbeiten erlaubt.

 $EnableGUIButtons = 1;

 $EnableUpload = 1;                       
 $DefaultPasswords['upload'] = '';
 $UploadMaxSize = 300000;

 $DiffKeepDays=30;                        # keep page history at least 30 days

 $GUIButtons['h1'] = array(400, '\\n! ', '\\n', '$[Heading]',
 $GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
 $GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
 $GUIButtons['right']  = array(411, '%25right%25', '', '',
 $GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]',
                     '$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"');
 $GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]',
                     '$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"');
 $GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]',
                     '$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"');
 $GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
                     '$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"');
 $GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
                     '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
 $GUIButtons['table'] = array(600,
                       '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n||     ||     ||     ||\\n||     ||     ||     ||\\n', '', '', 

 $DeleteKeyPattern = "^\\s*löschen\\s*$";

 $SearchPatterns['default'][] = '!\\.(All)?Recent(Changes|Uploads)$!';

 $EnablePostAuthorRequired = 1;



 $EnableSimulEdit = 0;



 $JPDateFmt = "!!!!!\$Date";
 $JPTimeFmt = "\n\n'''\$Time : '''";
 $DPDateFmt = "!!!!!\$Date\n";
 $DPItemFmt = "\n*";
 $MPDateFmt = "!!!!!\$Date";
 $MPTimeFmt = "\n\n'''\$Time - ''\$Author'' : '''";
 $MPItemFmt = "\n----";




 $SectionEditWithoutHeaders = true;
 $HTMLStylesFmt['sectionedit'] = "
div.sectionedit { text-align:right;font-size:smaller;float:right;}


and here ist the used config.php (with EnableDiag=1)

$EnableDiag = 1;

	$UploadUrlFmt = $FarmPubDirUrl.'/../../test/uploads';


$WikiTitle = 'Test';

 	$DefaultPasswords['edit'] = crypt(secret);
 	$DefaultPasswords['admin'] = crypt(test);
 	$DefaultPasswords['attr'] = ' ';
$HandleAuth['expirediff'] = 'edit';


##Allow backlink from comment page
Markup('{$BaseName}', '>{$fmt}','/{\\$BaseName}/',preg_replace('/-zzz-/', '.', FmtPageName('$Name', $pagename), 1));



EnableDiag is activated (phpinfo is disabled on the server). Hope this helps finding the problem...

Any ideas??


Ahh, I found the bug. Now fixed for 2.0.beta11. Thanks for all of the very useful information.

  • Great - had this bug too and thought I am totaly stupied :)

My pleasure - Klonk

I removed the testistalltion from my server again.