Help with LUadmin
Daimonos Tereutes <[email protected]> Fri, 02 Sep 2005 12:52:18 +0200
| Newsgroups | gmane.comp.php.pear.liveuser |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I made a little script to change my .htacces based acces control into liveuser
based one.
I didn't managed to use updateUser, anyone an advice ?
Here is the script:
<?php
$p1=$_POST['password'];
$lo=$_POST['handle'];
$filters = array(
'handle' => "$lo"
);
$found = $luadmin->getUsers($filters);
if ($found)
{
foreach($found as $user)
if ($user['handle'] == $lo)
{
print_r($user);
if ($err = $luadmin->updateUser($user['perm_user_id'], $user['handle'],
sha1($p1), array(), array(), $user['perm_type']))
echo "ok";
else
var_dump($err);
}
}else{
echo "false";
}
?>
and here is the result:
Array ( [auth_user_id] => 957f2d9faaa6d13dc0205cae32dd9ea7 [handle] => tereutes
[passwd] => 0KxFFhn5/aBjw [lastlogin] => 2005-08-30 11:24:47 [is_active] => 1
[perm_user_id] => 2 [auth_container_name] => DB [perm_type] => 6 )
Warning: array_key_exists() [function.array-key-exists]: The second argument
should be either an array or an object in
/usr/share/php/LiveUser/Admin/Auth/Common.php on line 292
Warning: Invalid argument supplied for foreach() in
/usr/share/php/LiveUser/Admin/Storage/SQL.php on line 203
Warning: Invalid argument supplied for foreach() in
/usr/share/php/LiveUser/Admin/Storage/SQL.php on line 217
MDB Error: syntax error:
UPDATE lu_users SET WHERE authuserid = '957f2d9faaa6d13dc0205cae32dd9ea7'
[nativecode=1064]
Debug backtrace:
@ PEAR.php:862 -- call_user_func(eHandler, Object)
@ MDB.php:726 -- PEAR_Error->PEAR_Error(MDB Error: syntax error, -2, 16,
eHandler, UPDATE lu_users SET
WHERE authuserid = '957f2d9faaa6d13dc0205cae32dd9ea7' [nativecode=1064])
@ PEAR.php:540 -- MDB_Error->MDB_Error(-2, 16, eHandler, UPDATE lu_users
SET
WHERE authuserid = '957f2d9faaa6d13dc0205cae32dd9ea7' [nativecode=1064])
@ Common.php:414 -- PEAR->raiseError(, -2, , , UPDATE lu_users SET
WHERE authuserid = '957f2d9faaa6d13dc0205cae32dd9ea7' [nativecode=1064],
MDB_Error, 1)
@ mysql.php:179 -- MDB_Common->raiseError(-2, , , , 1064)
@ mysql.php:507 -- MDB_mysql->mysqlRaiseError()
@ MDB.php:208 -- MDB_mysql->query(UPDATE lu_users SET
WHERE authuserid = '957f2d9faaa6d13dc0205cae32dd9ea7')
@ SQL.php:225 -- LiveUser_Admin_Storage_MDB->query(UPDATE lu_users SET
WHERE authuserid = '957f2d9faaa6d13dc0205cae32dd9ea7')
@ Common.php:295 -- LiveUser_Admin_Storage_SQL->update(users, tereutes,
Array)
@ Admin.php:508 -- LiveUser_Admin_Auth_Common->updateUser(tereutes, Array)
@ maj_passwd.php:26 -- LiveUser_Admin->updateUser(2, tereutes,
caa4343bfddab2fac6cad4221cd4c663eddb45d7, Array, Array, 6)
bool(false)
I tried different way of calling updateUser (with or without optional param) and
alway got an error.
Thanks in advance.
--
/~\ The ASCII Daimonos Tereutes
\ / Ribbon Campaign
X Against HTML [email protected]
/ \ Email!