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.