Thread: [phpMP-CVS] CVS: phpMP/includes auth.php,1.7,1.8 functions.php,1.7,1.8 template.php,1.12,1.13
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-04-11 05:40:18
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv3388/includes Modified Files: auth.php functions.php template.php Log Message: Updated more DBA. Added Extremely Basic News module. Index: auth.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/auth.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** auth.php 10 Apr 2002 21:22:02 -0000 1.7 --- auth.php 11 Apr 2002 05:40:15 -0000 1.8 *************** *** 53,57 **** $userinfo = $DBA->query('SELECT * FROM ' . $MPCONF['DB']['table_prefix'] . 'users WHERE username="' . $sess_user . '"'); ! $this->UserVars = @mysql_fetch_array($userinfo); return $this->UserVars; --- 53,57 ---- $userinfo = $DBA->query('SELECT * FROM ' . $MPCONF['DB']['table_prefix'] . 'users WHERE username="' . $sess_user . '"'); ! $this->UserVars = $DBA->fetch_array($userinfo); return $this->UserVars; *************** *** 84,89 **** $result = $DBA->query('SELECT username FROM ' . $MPCONF['DB']['table_prefix'] . "users WHERE username='{$HTTP_POST_VARS['username']}' AND password='$enc_password'"); ! if(@mysql_num_rows($result) == 1) { ! $data = @mysql_fetch_array($result); $sess_user = $data['username']; $sesskey = $this->getSessKey(); --- 84,90 ---- $result = $DBA->query('SELECT username FROM ' . $MPCONF['DB']['table_prefix'] . "users WHERE username='{$HTTP_POST_VARS['username']}' AND password='$enc_password'"); ! $num_rows = $DBA->num_rows($result); ! if($num_rows > 0) { ! $data = $DBA->fetch_array($result); $sess_user = $data['username']; $sesskey = $this->getSessKey(); *************** *** 99,103 **** $sess_user = $HTTP_COOKIE_VARS[$cookiename]; $result = $DBA->query('SELECT sesskey FROM ' . $MPCONF['DB']['table_prefix'] . 'sessions WHERE username = "' . $sess_user . '"'); ! if(@mysql_num_rows($result) == 1) { return $this->FetchUserVars($sess_user); setcookie($cookiename, $sess_user, $this->cookietime, $MPCONF['GEN']['uri']); --- 100,105 ---- $sess_user = $HTTP_COOKIE_VARS[$cookiename]; $result = $DBA->query('SELECT sesskey FROM ' . $MPCONF['DB']['table_prefix'] . 'sessions WHERE username = "' . $sess_user . '"'); ! $num_rows = $DBA->num_rows($result); ! if($num_rows > 0) { return $this->FetchUserVars($sess_user); setcookie($cookiename, $sess_user, $this->cookietime, $MPCONF['GEN']['uri']); *************** *** 112,119 **** $result = $DBA->query('SELECT username FROM ' . $MPCONF['DB']['table_prefix'] . 'users WHERE authstring="' . $authstring . '"'); ! if(@mysql_num_rows($result) == 1) { $sess_user = $username; $sesskey = $this->getSessKey(); ! @mysql_query("INSERT INTO " . $MPCONF['DB']['table_prefix'] . "sessions (sesskey, expiretime, username) VALUES('$sesskey', '" . $this->cookietime . "', '$sess_user')"); setcookie($cookiename, $sess_user, $this->cookietime, $MPCONF['GEN']['uri']); --- 114,122 ---- $result = $DBA->query('SELECT username FROM ' . $MPCONF['DB']['table_prefix'] . 'users WHERE authstring="' . $authstring . '"'); ! $num_rows = $DBA->num_rows($result); ! if($num_rows > 0) { $sess_user = $username; $sesskey = $this->getSessKey(); ! $DBA->query("INSERT INTO " . $MPCONF['DB']['table_prefix'] . "sessions (sesskey, expiretime, username) VALUES('$sesskey', '" . $this->cookietime . "', '$sess_user')"); setcookie($cookiename, $sess_user, $this->cookietime, $MPCONF['GEN']['uri']); Index: functions.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/functions.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** functions.php 10 Apr 2002 21:22:02 -0000 1.7 --- functions.php 11 Apr 2002 05:40:15 -0000 1.8 *************** *** 40,44 **** $sql = "SELECT * FROM " . $MPCONF['DB']['table_prefix'] . "config"; $db = $DBA->query($sql); ! while($row = @mysql_fetch_array($db)) { $MPCONF[$row['type']][$row['name']] = $row["value"]; } --- 40,44 ---- $sql = "SELECT * FROM " . $MPCONF['DB']['table_prefix'] . "config"; $db = $DBA->query($sql); ! while($row = $DBA->fetch_array($db)) { $MPCONF[$row['type']][$row['name']] = $row["value"]; } Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** template.php 11 Apr 2002 04:15:39 -0000 1.12 --- template.php 11 Apr 2002 05:40:15 -0000 1.13 *************** *** 176,183 **** $this->Blocking('BeginBlock'); - //$DBA->open(); $this->box_sql = "SELECT * FROM " . $MPCONF['DB']['table_prefix'] . "blocking WHERE side='" . $side . "' ORDER BY weight"; $data = $DBA->query($this->box_sql); ! while($data_array = @mysql_fetch_array($data)) { $blockname = ""; $content = ""; --- 176,182 ---- $this->Blocking('BeginBlock'); $this->box_sql = "SELECT * FROM " . $MPCONF['DB']['table_prefix'] . "blocking WHERE side='" . $side . "' ORDER BY weight"; $data = $DBA->query($this->box_sql); ! while($data_array = $DBA->fetch_array($data)) { $blockname = ""; $content = ""; *************** *** 190,204 **** $this->CreateBox($blockname, $content); } - //$DBA->close(); $this->Blocking('EndBlock'); } - - function ClosePage() { - global $MPCONF; - - session_close(); - } - } --- 189,195 ---- |