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
Assigned:
Priority: 2
Version: 2.1beta9
OS:

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?

--Pm


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) {
	RetrieveAuthPage($pagename,'LoginAction',true,READPAGE_CURRENT);
	Redirect($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:

 http://www.loncarek.de/test/index.php/Site/FlexiRight

the tabs are located in:

 http://www.loncarek.de/test/index.php/Site/FlexiHeader

I hope this helps.

--Klonk


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; ?

Thanks,

Pm


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]',
                     '$GUIButtonDirUrlFmt/h1.gif"$[Heading]"');
 $GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
                     '$GUIButtonDirUrlFmt/h2.gif"$[Heading]"');
 $GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
                     '$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"');
 $GUIButtons['right']  = array(411, '%25right%25', '', '',
                  '$GUIButtonDirUrlFmt/right.gif"$[Right]"');
 $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', '', '', 
                     '$GUIButtonDirUrlFmt/table.gif"$[Table]"');

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

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

 $EnablePostAuthorRequired = 1;

 include_once("$FarmD/cookbook/pagestoregz.php");

 include_once("$FarmD/scripts/refcount.php");

 $EnableSimulEdit = 0;
 include_once("$FarmD/cookbook/simuledit/simuledit.php");

 include_once("$FarmD/cookbook/e-protect.php");

 include_once("$FarmD/cookbook/smileys.php");

 include_once("$FarmD/cookbook/commentbox.php");
 $JPDateFmt = "!!!!!\$Date";
 $JPTimeFmt = "\n\n'''\$Time : '''";
 $DPDateFmt = "!!!!!\$Date\n";
 $DPItemFmt = "\n*";
 $MPDateFmt = "!!!!!\$Date";
 $MPTimeFmt = "\n\n'''\$Time - ''\$Author'' : '''";
 $MPItemFmt = "\n----";

 include_once("$FarmD/cookbook/deletepage.php");

 include_once("$FarmD/cookbook/expirediff.php");

 include_once("$FarmD/cookbook/searchterms.php");

 $SectionEditWithoutHeaders = true;
 $HTMLStylesFmt['sectionedit'] = "
div.sectionedit { text-align:right;font-size:smaller;float:right;}
";
 include_once("$FarmD/cookbook/sectionedit.php");

?>

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

 
<?php
$EnableDiag = 1;

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

	$Skin='flexi';
	$ActionSkin['print']='flexi';
	$FlexiSkin['CSS']="clean.css";

$WikiTitle = 'Test';

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

$EnablePageStoreGZ=0; 

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

 include_once("$FarmD/cookbook/sectionedit.php");

?>

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

Any ideas??

--Klonk


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.