[Phpslash-commit] CVS: phpslash-dev/public_html config_setup.php,1.11,1.12
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2004-10-20 16:36:08
|
Update of /cvsroot/phpslash/phpslash-dev/public_html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13334/phpslash-dev/public_html Modified Files: config_setup.php Log Message: Require username and password entry when using the install wizard on new installations. Index: config_setup.php =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/public_html/config_setup.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** config_setup.php 19 Oct 2004 21:41:19 -0000 1.11 --- config_setup.php 20 Oct 2004 16:35:59 -0000 1.12 *************** *** 777,781 **** <tr class="banner"> <td>Additional Data to install</td> ! </td> <tr> --- 777,781 ---- <tr class="banner"> <td>Additional Data to install</td> ! </tr> <tr> *************** *** 792,795 **** --- 792,816 ---- </div> </td> + </tr> + <tr class="banner"> + <td>Set Adminstrator User Name and Password</td> + </tr> + <tr> + <td> + <p>Enter the name and password that will be used to administer <?php print PRODUCT;?>.</p> + <div align="center"> + <table align="center"> + <tr class="setVal" valign="top"> + <td class="name">Admin name</td> + <td class=""><input type="text" name="user[adminname]" value=""></td> + </tr> + + <tr class="setVal" valign="top"> + <td class="name">Admin Password</td> + <td class="value"><input type="text" name="user[adminpass]" value=""></td> + </tr> + </table> + </div> + </td> </tr> *************** *** 1010,1013 **** --- 1031,1058 ---- } + if(!isset($_REQUEST['user']['adminname']) || !isset($_REQUEST['user']['adminpass'])) { + _setError( + "Please set the administrator user name and password.", + __LINE__ + ); + + return STEP_ERROR; + } else { + $sqlCmd = "UPDATE psl_author + SET author_name = '" . mysql_escape_string($_REQUEST['user']['adminname'])."', + author_realname = '". mysql_escape_string($_REQUEST['user']['adminname']) ."', + password = MD5('". mysql_escape_string($_REQUEST['user']['adminname']).":".mysql_escape_string($_REQUEST['user']['adminpass'])."') + WHERE author_id = '1'"; + $result = mysql_query($sqlCmd ); + if (mysql_errno() != 0) { + _setError( + "SQL failed: <pre>$sqlCmd</pre><br>Server said: " + . mysql_error(), + __LINE__ + ); + return STEP_ERROR; + } + + } return STEP_OK; } *************** *** 1034,1039 **** <p> ! The configuration of <?php print PRODUCT;?> is complete. The default username is ! <tt>god</tt>, and the default password is <tt>password</tt>. <center> --- 1079,1083 ---- <p> ! The configuration of <?php print PRODUCT;?> is complete. <center> |