[CWB] Two issues regarding CQPweb revision 316
Hardie, Andrew
a.hardie at lancaster.ac.uk
Mon May 21 22:17:28 CEST 2012
Hi Ray,
I am still a bit stumped; I cannot reproduce this bug. So I need you to hack your code again! Can I suggest that you try the following.
(1) replace the complete function add_new_user() { ... } (lines 179-203) as follows:
function add_new_user($username, $password, $email = NULL)
{
$apache = get_apache_object('nopath');
$username = preg_replace('/\W/', '', $username);
$password = preg_replace('/\W/', '', $password);
$vv="Initialisation variables:";
show_var($username); show_var($password);show_var($apache);
if ($username === '' || $password === '')
exiterror_fullpage("Usernames and passwords can only contain letters, numbers and underscores.",
__FILE__, __LINE__);
$vv = "Calling new user, printing retval..."; show_var($vv);
$dd = $apache->new_user($username, $password); show_var($dd);
/* start by creating a blank entry for the user (or, retrieving an existing entry) */
$profile = get_all_user_settings($username);
$vv = "The profile is...";show_var($vv);show_var($profile);
/* then, overwrite the password as stored in the database */
global $password_more_security;
show_var($password_more_security);
$db_password = ($password_more_security ? $apache->get_user_hashword($username) : $password);
update_user_setting($username, 'password', $db_password);
$vv = "Email to update?";show_var($vv);
/* and if email has been passed into the function, likewise overwrite it */
if (isset($email))
{
show_var($email);
update_user_setting($username, 'email', mysql_real_escape_string($email));
}
}
?>
(2) add the following line to your config.inc.php file.
$print_debug_messages = true;
(3) Try again to create a user.
(4) Send me the resulting text output.
Hopefully this time we’ll nail it.
best
Andrew.
From: cwb-bounces at sslmit.unibo.it [mailto:cwb-bounces at sslmit.unibo.it] On Behalf Of Ray Wu
Sent: 21 May 2012 01:49
To: Open source development of the Corpus WorkBench
Subject: Re:RE: [CWB] Two issues regarding CQPweb revision 316
Hi Andrew,
I tried your update and here is my report.
Re: OK, I have solved the freq table issue I think – it was a bug due to me supplying the wrong argument format to the PHP function is_writable(). Update to svn commit 318 and you should be good to go on that front.
You are a genius! It rocks!
Re: For the user creation issue: can I suggest you temporarily change line 190 of admin-lib.inc.php as follows: from
$apache->new_user($username, $password); to
$dd = $apache->new_user($username, $password); show_var($dd);
and try creating a user to see what happens?
Pressing "Creat user account", yields -->$<--int(0) ;
Pressing "Create a batch of user accounts" yields no output.
Newly created users appear in "Delete a user account" but not in "Set user's maximum database size"
Best,
Ray
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20120521/2f27d417/attachment-0001.htm
More information about the CWB
mailing list