[Phpslash-commit] CVS: phpslash-dev/include/modules/auth index.php,NONE,1.1
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2004-09-16 19:21:32
|
Update of /cvsroot/phpslash/phpslash-dev/include/modules/auth In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12340/phpslash-dev/include/modules/auth Added Files: index.php Log Message: added auth/index.php --- NEW FILE: index.php --- <?php // $Id: index.php,v 1.1 2004/09/16 19:21:22 joestewart Exp $ global $sess, $auth, $perm, $HTTP_POST_VARS, $HTTP_GET_VARS, $HTTP_COOKIE_VARS; $pagetitle = pslgetText('Administration'); // The name to be displayed in the header $xsiteobject = pslgetText('Administration Page'); // This Defines The META Tag Object Type $content = ''; if (isset($HTTP_POST_VARS['cancel'])) { $sess->delete(); Header("Location: " . $_PSL['rooturl'] ."/"); // go home die("\n"); // Kill script if not dead already, possible memory leak } if ((!empty($HTTP_GET_VARS['logout'])) && ($perm->have_perm('user'))) { // if (isset($HTTP_GET_VARS['logout'])) { if(isset($HTTP_COOKIE_VARS['user_info'])) { $user_info = unserialize(base64_decode($HTTP_COOKIE_VARS['user_info'])); if(!array_key_exists('preferences',$user_info)) { $rooturl_ary = parse_url($this->psl['rooturl']); setcookie( 'user_info', '', time()-31536000, $rooturl_ary['path'], "", ""); // $sess->delete(); $HTTP_COOKIE_VARS['user_info'] = ''; } } // expire cache for this session if(function_exists('jpcache_gc')) { jpcache_gc('string', "-slashSess-" . $sess->id, "100"); } $username = $auth->auth['uname']; // $sess->delete(); // may be needed for phplib session4.inc // discard prefs when logging out. $auth->auth['preferences'] = ''; $auth->auth["error"] = sprintf(pslgetText("%s logged out."), $username); $auth->auth['uid'] = 'nobody'; $auth->auth['perm'] = ""; $HTTP_GET_VARS['logout'] = ''; } // old kludge for phplib to accept login from an external form such as the login block. Will be removed. jvs - 02/18/2003 - // If new auth had replaced existing phplib auth. 08/30/2004 if(isset($_POST['username']) && !$perm->have_perm('user')) { // this would be present if a login is in progress $auth->auth["uid"]= "form"; // this is what auth seems to want $auth->start(); } $auth->login_if(!$perm->have_perm('user')); return $content; page_close(); ?> |