Jonathan Angliss ([EMAIL PROTECTED]) had this to say on 01/01/03 at 03:33: 
> Hello Mike,
> On Tuesday, December 31, 2002, Mike Leone wrote...
> 
> > Using SM 1.2.10, on apache 1.3.26, PHP 4.1.2.
> 
> > I installed the abook_import_export plugin, and it is active. However, when
> > I try an import a CSV file (created by Outlook), I get a frame that states
> 
> > You need a valid user and password to access this page!
> 
> > Yet there was no page that asked for a username and password. (besides the
> > normal SM login, which I had already done). I see nothing in the README that
> > mentions anything similar. 
> 
> > BTW, I do see this on the setup.php that comes with that plugin:
> 
> >       <INPUT TYPE="hidden" NAME="max_file_size" value="5000">
>       
> >       The documentation doesn't mention a max file size. Why 5K? Any
> > particular reason?
> 
> From what I've read... and seen... I've not seen a browser that
> supports that tag. So unless PHP is doing something with it, then it
> is pointless.
> 
> > Also, I see that the actual import routine does this:
> 
> > session_start();
>      
> > if(!isset($username)) {
> >    echo "You need a valid user and password to access this page!";
> >    exit;
> > }
>          
> > I presume I have no $username set? Why not, tho? I do see my username (I
> > have SM set to show last login time).
> 
> There is two problems here.  The first is, it assumes register_globals
> is set to On.  The second is in 1.2.10 we renamed sessions.  Make sure
> that the file src/global.php is included above your session_start();
> Do this via:
> 
>   require_once('../src/global.php');
> 
> You might need to issue a chdir('..'); above that line to make it work
> down a level, or simple just extend the require via:
> 
>   require_once('../../src/global.php');
> 
> If you are running with register_globals set to On, you can ignore the
> first problem, but certainly cannot ignore the second.  If you are
> running with register_globals set to Off, after session_start(); put
> the following line:
> 
>   $username = $_SESSION('username');
> 
> And try again.

Register_Globals was set to On. I set it to Off.

I changed the code to:

   require_once('../../src/global.php');
   
   session_start();
   $username = $_SESSION('username');
         
I now get this:

Fatal error:  Call to undefined function:  array() in
/usr/share/squirrelmail/plugins/ abook_import_export/address_book_import.php
on line 20

-- 
PGP Fingerprint: 0AA8 DC47 CB63 AE3F C739 6BF9 9AB4 1EF6 5AA5 BCDF
Member, LEAF Project <http://leaf.sourceforge.net>    AIM: MikeLeone
Public Key - <http://www.mike-leone.com/~turgon/turgon-public-key.asc>
Registered Linux user# 201348

Attachment: msg01618/pgp00000.pgp
Description: PGP signature

Reply via email to