<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi Andrew,<br><br>I edited the two php files in my /usr/local/apache2/htdocs/cqp/lib directory and here is the output after pressing the button "Creat user account" under the banner of "Create new user (or reset user password)":<br><br>-->$<--<br>string(9) "anonymous"<br><br>-->$<--<br>string(9) "anonymous"<br><br>-->$<--<br>object(apache_htaccess)#2 (8) {<br> ["AuthName:private"]=><br> string(6) "CQPweb"<br> ["path_to_apache_password_utility_directory:private"]=><br> string(22) "/usr/local/apache2/bin"<br> ["path_to_groups_file:private"]=><br> string(43) "/usr/local/apache2/cqpweb_aux/user/.htgroup"<br> ["path_to_password_file:private"]=><br> string(44) "/usr/local/apache2/cqpweb_aux/user/.htpasswd"<br> ["path_to_web_directory:private"]=><br> string(6) "nopath"<br> ["permitted_users:private"]=><br> NULL<br> ["permitted_groups:private"]=><br> NULL<br> ["extra_directives:private"]=><br> NULL<br>}<br><br>-->$<--<br>string(36) "Calling new user, printing retval..."<br><br>-->$<--<br>int(0)<br><br>About to run the following MySQL query:<br><br>SELECT * from user_settings WHERE username = 'anonymous'<br><br><br>The query ran successfully in 0 seconds.<br><br><br>About to run the following MySQL query:<br><br>INSERT INTO user_settings (<br> username,<br> realname,<br> conc_kwicview,<br> conc_corpus_order,<br> cqp_syntax,<br> context_with_tags,<br> use_tooltips,<br> thin_default_reproducible,<br> coll_statistic,<br> coll_freqtogether,<br> coll_freqalone,<br> coll_from,<br> coll_to,<br> max_dbsize,<br> linefeed<br> )<br> VALUES<br> (<br> 'anonymous',<br> 'unknown person',<br> 1,<br> 1,<br> 0,<br> 0,<br> 1,<br> 1,<br> 6,<br> 5,<br> 5,<br> -3,<br> 3,<br> 1000000,<br> 'au')<br><br>The query ran successfully in 0 seconds.<br><br>About to run the following MySQL query:<br><br>SELECT * from user_settings WHERE username = 'anonymous'<br><br>The query ran successfully in 0 seconds.<br><br>-->$<--<br>string(17) "The profile is..."<br><br>-->$<--<br>object(stdClass)#3 (17) {<br> ["username"]=><br> string(9) "anonymous"<br> ["password"]=><br> NULL<br> ["realname"]=><br> string(14) "unknown person"<br> ["email"]=><br> NULL<br> ["conc_kwicview"]=><br> string(1) "1"<br> ["conc_corpus_order"]=><br> string(1) "1"<br> ["cqp_syntax"]=><br> string(1) "0"<br> ["context_with_tags"]=><br> string(1) "0"<br> ["use_tooltips"]=><br> string(1) "1"<br> ["thin_default_reproducible"]=><br> string(1) "1"<br> ["coll_statistic"]=><br> string(1) "6"<br> ["coll_freqtogether"]=><br> string(1) "5"<br> ["coll_freqalone"]=><br> string(1) "5"<br> ["coll_from"]=><br> string(2) "-3"<br> ["coll_to"]=><br> string(1) "3"<br> ["max_dbsize"]=><br> string(7) "1000000"<br> ["linefeed"]=><br> string(2) "au"<br>}<br><br>-->$password_more_security<--<br>bool(false)<br><br>About to run the following MySQL query:<br><br>UPDATE user_settings SET password = 'anonymous' WHERE username = 'anonymous'<br><br><br>The query ran successfully in 0 seconds.<br><br><br>-->$<--<br>string(16) "Email to update?"<br><br>-->$<--<br>string(0) ""<br><br>About to run the following MySQL query:<br><br>UPDATE user_settings SET email = '' WHERE username = 'anonymous'<br><br>The query ran successfully in 0 seconds.<br><br>Best,<br>Ray<br><br><br>At 2012-05-22 04:17:28,"Hardie, Andrew" <a.hardie@lancaster.ac.uk> wrote:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<style></style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Hi Ray,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><span style="mso-list:Ignore">(1)<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">replace the complete
<b>function add_new_user() { ... }</b> (lines 179-203) as follows:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">function add_new_user($username, $password, $email = NULL)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $apache = get_apache_object('nopath');<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $username = preg_replace('/\W/', '', $username);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $password = preg_replace('/\W/', '', $password);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $vv="Initialisation variables:";<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> show_var($username); show_var($password);show_var($apache);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> if ($username === '' || $password === '')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> exiterror_fullpage("Usernames and passwords can only contain letters, numbers and underscores.",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> __FILE__, __LINE__);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $vv = "Calling new user, printing retval..."; show_var($vv);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $dd = $apache->new_user($username, $password); show_var($dd);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> /* start by creating a blank entry for the user (or, retrieving an existing entry) */<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $profile = get_all_user_settings($username);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $vv = "The profile is...";show_var($vv);show_var($profile);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> /* then, overwrite the password as stored in the database */<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> global $password_more_security;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> show_var($password_more_security);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $db_password = ($password_more_security ? $apache->get_user_hashword($username) : $password);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> update_user_setting($username, 'password', $db_password);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> $vv = "Email to update?";show_var($vv);
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> /* and if email has been passed into the function, likewise overwrite it */<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> if (isset($email))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> show_var($email);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> update_user_setting($username, 'email', mysql_real_escape_string($email));<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> ?><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><span style="mso-list:Ignore">(2)<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">add the following line to your config.inc.php file.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Courier New";color:#19177C;background:white">$print_debug_messages = true;</span><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><span style="mso-list:Ignore">(3)<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Try again to create a user.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><span style="mso-list:Ignore">(4)<span style="font:7.0pt "Times New Roman"">
</span></span></span><!--[endif]--><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Send me the resulting text output.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Hopefully this time we’ll nail it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">best<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Andrew.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> <a href="mailto:cwb-bounces@sslmit.unibo.it">cwb-bounces@sslmit.unibo.it</a> [mailto:<a href="mailto:cwb-bounces@sslmit.unibo.it">cwb-bounces@sslmit.unibo.it</a>]
<b>On Behalf Of </b>Ray Wu<br>
<b>Sent:</b> 21 May 2012 01:49<br>
<b>To:</b> Open source development of the Corpus WorkBench<br>
<b>Subject:</b> Re:RE: [CWB] Two issues regarding CQPweb revision 316<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black">Hi Andrew,<br>
<br>
I tried your update and here is my report.<br>
<br>
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.<br>
You are a genius! It rocks! <br>
<br>
Re: For the user creation issue: can I suggest you temporarily change line 190 of admin-lib.inc.php as follows: from
<br>
$apache->new_user($username, $password); to<br>
$dd = $apache->new_user($username, $password); show_var($dd);<br>
and try creating a user to see what happens?<br>
<br>
Pressing "Creat user account", yields -->$<--int(0) ;<br>
Pressing "Create a batch of user accounts" yields no output.<br>
Newly created users appear in "Delete a user account" but not in "Set user's maximum database size"<br>
<br>
Best,<br>
Ray<br>
<br>
<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</div>
</blockquote></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>