[Openfirst-cvscommit] base/config auth.php,1.15,1.16 dbase.php,1.21,1.22
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-03-22 22:23:00
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21666/config Modified Files: auth.php dbase.php Log Message: Moved user creation code to ofirst_dbcreate() Index: auth.php =================================================================== RCS file: /cvsroot/openfirst/base/config/auth.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** auth.php 24 Dec 2003 03:28:26 -0000 1.15 --- auth.php 22 Mar 2005 22:22:35 -0000 1.16 *************** *** 55,59 **** // Show a login form for the user. ! echo("<br><br><form action='". $_SERVER["PHP_SELF"] . "' method='post'>"); if(isset($_SERVER["HTTP_REFERER"])){ echo("<input name='referer' type='hidden' value='".$_SERVER["HTTP_REFERER"]."'/>"); --- 55,59 ---- // Show a login form for the user. ! echo("<br /><br /><form action='". $_SERVER["PHP_SELF"] . "' method='post'>"); if(isset($_SERVER["HTTP_REFERER"])){ echo("<input name='referer' type='hidden' value='".$_SERVER["HTTP_REFERER"]."'/>"); *************** *** 75,86 **** <tr> <td> </td> ! <td><input type=\"submit\" value=\"Login\">"; if(!isset($GLOBALS["pass_save_disabled"])){ ! echo " <br><input type=checkbox name=savepass id=savepass value=1 checked><label for=savepass>Save Password</label>"; } echo("</td></tr> <tr><td> </td><td><a href=\"".$GLOBALS["basepath"]."/members/forgotten.php\">Forgot Password</a></td></tr> </table> ! </form><br><br>"); return(0); } --- 75,86 ---- <tr> <td> </td> ! <td><input type=\"submit\" value=\"Login\" />"; if(!isset($GLOBALS["pass_save_disabled"])){ ! echo " <br /><input type=checkbox name=savepass id=savepass value=1 checked /><label for=savepass>Save Password</label>"; } echo("</td></tr> <tr><td> </td><td><a href=\"".$GLOBALS["basepath"]."/members/forgotten.php\">Forgot Password</a></td></tr> </table> ! </form><br /><br />"); return(0); } *************** *** 158,162 **** // There was an error, check if it's because they didn't create the // members table. ! if(ofirst_dberrno() == 1146) { echo("<p>Members table does not exist, therefore I am creating it.</p>"); $query = ofirst_dbquery("CREATE TABLE ofirst_members ( --- 158,162 ---- // There was an error, check if it's because they didn't create the // members table. ! /* if(ofirst_dberrno() == 1146) { echo("<p>Members table does not exist, therefore I am creating it.</p>"); $query = ofirst_dbquery("CREATE TABLE ofirst_members ( *************** *** 197,201 **** die(ofirst_dberror()); } ! } } if(isset($user->user)){ --- 197,201 ---- die(ofirst_dberror()); } ! }*/ } if(isset($user->user)){ Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/config/dbase.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** dbase.php 22 Mar 2005 22:08:26 -0000 1.21 --- dbase.php 22 Mar 2005 22:22:35 -0000 1.22 *************** *** 290,293 **** --- 290,329 ---- PRIMARY KEY (`modulename`) )"); + /* copied from auth.php */ + echo("<p>Members table does not exist, therefore I am creating it.</p>"); + $query = ofirst_dbquery("CREATE TABLE ofirst_members ( + UNIQUE(user), + user CHAR(128), + firstname TINYTEXT, + lastname TINYTEXT, + lastseen TINYTEXT, + ip TINYTEXT, + password TEXT, + authcode TEXT, + membertype TINYTEXT, + division TINYTEXT, + year INTEGER, + email TEXT, + icq INTEGER, + aim TINYTEXT, + msn TINYTEXT, + yim TINYTEXT, + description TEXT, + signature TINYTEXT, + dateregistered TINYTEXT, + picturelocation TINYTEXT, + team INTEGER, + skills TEXT + );"); + if(ofirst_dberrno() == 0) { + // Insert a default user 'administrator' and set them to have + // administrative access and some password. + + $query = ofirst_dbquery("INSERT INTO ofirst_members (user, + membertype, password) VALUES('admin', 'administrator', '" . + cryptpassword("openfirst", $encryption) ."');"); + echo("<p>Members table has been created. Please login as <b>admin</b> using the password <b>openfirst</b> to set configuration options.</p>"); + } + /* End copy */ } ?> |