From: <on...@us...> - 2002-09-11 20:18:24
|
Update of /cvsroot/xoops/xoops-current/html In directory usw-pr-cvs1:/tmp/cvs-serv27417 Modified Files: user.php Log Message: no message Index: user.php =================================================================== RCS file: /cvsroot/xoops/xoops-current/html/user.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** user.php 5 Sep 2002 04:10:52 -0000 1.3 --- user.php 11 Sep 2002 20:18:16 -0000 1.4 *************** *** 18,28 **** // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------- // ! $xoopsOption['pagetype'] = "user"; include('mainfile.php'); ! function main() { ! global $xoopsUser, $HTTP_COOKIE_VARS, $xoopsConfig, $xoopsTheme; if ( !$xoopsUser ) { ! include("header.php"); OpenTable(); echo "<form action='user.php' method='post'><b>"._US_USERLOGIN."</b><br /><br />". _US_NICKNAMECOLON."<input class='textbox' type='text' name='uname' size='26' maxlength='25'"; --- 18,35 ---- // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------- // ! $xoopsOption['pagetype'] = 'user'; include('mainfile.php'); ! $op = 'main'; ! ! if ( isset($HTTP_POST_VARS['op']) ) { ! $op = trim($HTTP_POST_VARS['op']); ! } elseif ( isset($HTTP_GET_VARS['op']) ) { ! $op = trim($HTTP_GET_VARS['op']); ! } ! ! if ($op == 'main') { if ( !$xoopsUser ) { ! include('header.php'); OpenTable(); echo "<form action='user.php' method='post'><b>"._US_USERLOGIN."</b><br /><br />". _US_NICKNAMECOLON."<input class='textbox' type='text' name='uname' size='26' maxlength='25'"; *************** *** 36,63 **** echo "<b>"._US_LOSTPASSWORD."</b><br /><br />"._US_NOPROBLEM."<br /><form action='lostpass.php' method='post'>". _US_YOUREMAIL ."<input class='textbox' type='text' name='email' size='26' maxlength='60' />  <input type='hidden' name='op' value='mailpasswd' /><input type='submit' value='"._US_SENDPASSWORD."' />"; CloseTable(); ! echo "</form>"; ! include("footer.php"); } elseif ( $xoopsUser ) { ! Header("Location: ".XOOPS_URL."/userinfo.php?uid=".$xoopsUser->getVar("uid").""); ! //redirect_header("userinfo.php?uid=".$xoopsUser->getVar("uid")."",0,_US_TAKINGYOU); ! exit(); ! } ! } ! ! function logout() { ! global $xoopsConfig, $xoopsUser; ! if ( $xoopsUser ) { ! $xoopsUser->logout(); } - $message = _US_LOGGEDOUT; - $message .= "<br />"._US_THANKYOUFORVISIT."<br />"; - redirect_header("index.php",1,$message); exit(); } ! function login($uname, $pass) { ! $uname = trim($uname); ! $pass = trim($pass); ! if ( !isset($uname) || !isset($pass) || $uname == "" || $pass == "" ) { redirect_header("user.php",1,_US_INCORRECTLOGIN); exit(); --- 43,58 ---- echo "<b>"._US_LOSTPASSWORD."</b><br /><br />"._US_NOPROBLEM."<br /><form action='lostpass.php' method='post'>". _US_YOUREMAIL ."<input class='textbox' type='text' name='email' size='26' maxlength='60' />  <input type='hidden' name='op' value='mailpasswd' /><input type='submit' value='"._US_SENDPASSWORD."' />"; CloseTable(); ! echo '</form>'; ! include('footer.php'); } elseif ( $xoopsUser ) { ! header('Location: '.XOOPS_URL.'/userinfo.php?uid='.$xoopsUser->getVar('uid')); } exit(); } ! if ($op == 'login') { ! $uname = trim($HTTP_POST_VARS['uname']); ! $pass = trim($HTTP_POST_VARS['pass']); ! if ( !isset($uname) || !isset($pass) || $uname == '' || $pass == '' ) { redirect_header("user.php",1,_US_INCORRECTLOGIN); exit(); *************** *** 66,70 **** if ( false != $user) { if ( 0 == $user->getVar('level') ) { ! redirect_header("index.php",5,_US_NOACTTPADM); exit(); } --- 61,65 ---- if ( false != $user) { if ( 0 == $user->getVar('level') ) { ! redirect_header('index.php',5,_US_NOACTTPADM); exit(); } *************** *** 77,164 **** $user->updateLastLogin(); redirect_header('index.php', 1, sprintf(_US_LOGGINGU, $user->getVar('uname'))); - exit(); } else { ! redirect_header("user.php",1,_US_INCORRECTLOGIN); ! exit(); } } ! function activate($id,$key) { ! global $xoopsDB; ! if ( empty($id) || !is_numeric($id) ) { ! redirect_header("index.php",1,""); exit(); } $thisuser = new XoopsUser($id); ! if ( $thisuser->actkey() != $key ) { ! redirect_header("index.php",5,_US_ACTKEYNOT); ! exit(); } else { if ( $thisuser->isActive() ) { ! redirect_header("user.php",5,_US_ACONTACT); ! exit(); } else { if ($thisuser->activate()) { ! redirect_header("user.php",5,_US_ACTLOGIN); ! exit(); } else { ! redirect_header("index.php",5,"Activation failed!"); ! exit(); } } } } ! function delete($ok=0) { ! global $xoopsUser, $xoopsConfig, $xoopsTheme; ! if ( !$xoopsUser || !$xoopsConfig['self_delete'] ) { ! redirect_header("index.php",5,_US_NOPERMISS); exit(); } else { ! if ( !$ok ) { ! include("header.php"); ! echo "<div><h4>"._US_SURETODEL."</h4>". _US_REMOVEINFO."<br />"; ! echo "<table><tr><td>\n"; ! // need to change to POST here ! echo myTextForm("user.php?op=delete&ok=1", _US_YES); ! echo "</td><td>\n"; ! // need to change to POST here ! echo myTextForm("user.php", _US_NO); ! echo "</td></tr></table></div>\n"; ! include("footer.php"); ! exit(); } else { $xoopsUser->delete(); ! redirect_header("index.php",5,_US_BEENDELED); ! exit(); } } - } - - - $op = "main"; - if ( isset($HTTP_POST_VARS['op']) ) { - $op = trim($HTTP_POST_VARS['op']); - } elseif ( isset($HTTP_GET_VARS['op']) ) { - $op = trim($HTTP_GET_VARS['op']); - } - - switch($op) { - case "logout": - logout(); - break; - case "login": - login($HTTP_POST_VARS['uname'], $HTTP_POST_VARS['pass']); - break; - case "actv": - activate($HTTP_GET_VARS['id'], $HTTP_GET_VARS['actkey']); - break; - case "delete": - delete($HTTP_GET_VARS['ok']); - break; - case "main": - default: - main(); - break; } ?> --- 72,126 ---- $user->updateLastLogin(); redirect_header('index.php', 1, sprintf(_US_LOGGINGU, $user->getVar('uname'))); } else { ! redirect_header('user.php',1,_US_INCORRECTLOGIN); } + exit(); } ! if ($op == 'actv') { ! $id = intval($HTTP_GET_VARS['id']); ! $actkey = trim($HTTP_GET_VARS['actkey']); ! if (empty($id)) { ! redirect_header('index.php',1,''); exit(); } $thisuser = new XoopsUser($id); ! if ( $thisuser->actkey() != $actkey ) { ! redirect_header('index.php',5,_US_ACTKEYNOT); } else { if ( $thisuser->isActive() ) { ! redirect_header('user.php',5,_US_ACONTACT); } else { if ($thisuser->activate()) { ! redirect_header('user.php',5,_US_ACTLOGIN); } else { ! redirect_header('index.php',5,'Activation failed!'); } } } + exit(); } ! if ($op == 'delete') { ! if (!$xoopsUser || !$xoopsConfig['self_delete']) { ! redirect_header('index.php',5,_US_NOPERMISS); exit(); } else { ! $ok = !isset($HTTP_GET_VARS['ok']) ? 0 : intval($HTTP_GET_VARS['ok']); ! if ($ok != 1) { ! include('header.php'); ! echo '<div><h4>'._US_SURETODEL.'</h4>'. _US_REMOVEINFO.'<br />'; ! echo '<table><tr><td>'; ! echo myTextForm('user.php?op=delete&ok=1', _US_YES); ! echo '</td><td>'; ! echo myTextForm('user.php', _US_NO); ! echo '</td></tr></table></div>'; ! include('footer.php'); } else { $xoopsUser->delete(); ! redirect_header('index.php', 5, _US_BEENDELED); } + exit(); } } ?> |