mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Some code cleanup. auto-redirection to previous admin page if log back in within 5 mins.
This commit is contained in:
64
class2.php
64
class2.php
@@ -9,8 +9,8 @@
|
|||||||
* General purpose file
|
* General purpose file
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
||||||
* $Revision: 1.160 $
|
* $Revision: 1.161 $
|
||||||
* $Date: 2009-11-19 10:07:28 $
|
* $Date: 2009-11-22 14:10:00 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -484,7 +484,7 @@ else
|
|||||||
|
|
||||||
//TODO - this could be part of e107->init() method now, prefs will be auto-initialized
|
//TODO - this could be part of e107->init() method now, prefs will be auto-initialized
|
||||||
//when proper called (e107::getPref())
|
//when proper called (e107::getPref())
|
||||||
$e107->set_base_path();
|
// $e107->set_base_path(); moved to init().
|
||||||
|
|
||||||
//DEPRECATED, BC, call e107::getConfig('menu')->get('pref_name') only when needed
|
//DEPRECATED, BC, call e107::getConfig('menu')->get('pref_name') only when needed
|
||||||
$menu_pref = e107::getConfig('menu')->getPref(); //extract menu prefs
|
$menu_pref = e107::getConfig('menu')->getPref(); //extract menu prefs
|
||||||
@@ -553,7 +553,6 @@ if ($pref['user_tracking'] == 'session')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
define('e_SELF', ($pref['ssl_enabled'] == '1' ? 'https://'.$_SERVER['HTTP_HOST'] : 'http://'.$_SERVER['HTTP_HOST']) . ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']));
|
|
||||||
|
|
||||||
// if the option to force users to use a particular url for the site is enabled, redirect users there as needed
|
// if the option to force users to use a particular url for the site is enabled, redirect users there as needed
|
||||||
// Now matches RFC 2616 (sec 3.2): case insensitive, https/:443 and http/:80 are equivalent.
|
// Now matches RFC 2616 (sec 3.2): case insensitive, https/:443 and http/:80 are equivalent.
|
||||||
@@ -606,8 +605,8 @@ if($pref['redirectsiteurl'] && $pref['siteurl']) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$page = substr(strrchr($_SERVER['PHP_SELF'], '/'), 1);
|
// $page = substr(strrchr($_SERVER['PHP_SELF'], '/'), 1);
|
||||||
define('e_PAGE', $page);
|
// define('e_PAGE', $page);
|
||||||
|
|
||||||
// sort out the users language selection
|
// sort out the users language selection
|
||||||
if (isset($_POST['setlanguage']) || isset($_GET['elan']) || isset($GLOBALS['elan']))
|
if (isset($_POST['setlanguage']) || isset($_GET['elan']) || isset($GLOBALS['elan']))
|
||||||
@@ -966,16 +965,12 @@ if(varset($pref['force_userupdate']) && USER && !isset($_E107['no_forceuserupdat
|
|||||||
|
|
||||||
$sql->db_Mark_Time('Start: Signup/splash/admin');
|
$sql->db_Mark_Time('Start: Signup/splash/admin');
|
||||||
|
|
||||||
define('e_SIGNUP', e_BASE.(file_exists(e_BASE.'customsignup.php') ? 'customsignup.php' : 'signup.php'));
|
|
||||||
define('e_LOGIN', e_BASE.(file_exists(e_BASE.'customlogin.php') ? 'customlogin.php' : 'login.php'));
|
|
||||||
|
|
||||||
if(($pref['membersonly_enabled'] && !isset($_E107['allow_guest'])) || $pref['maintainance_flag'])
|
if(($pref['membersonly_enabled'] && !isset($_E107['allow_guest'])) || $pref['maintainance_flag'])
|
||||||
{
|
{
|
||||||
//XXX move force_userupdate() also?
|
//XXX move force_userupdate() also?
|
||||||
require_once(e_HANDLER."redirection_class.php");
|
e107::getRedirect()->checkMaintenance();
|
||||||
$redirect = new redirection;
|
e107::getRedirect()->checkMembersOnly();
|
||||||
$redirect->checkMaintenance();
|
|
||||||
$redirect->checkMembersOnly();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
@@ -1018,7 +1013,8 @@ if ((e_QUERY == 'logout') || (($pref['user_tracking'] == 'session') && isset($_S
|
|||||||
|
|
||||||
cookie(e_COOKIE, '', (time() - 2592000));
|
cookie(e_COOKIE, '', (time() - 2592000));
|
||||||
e107::getEvent()->trigger('logout');
|
e107::getEvent()->trigger('logout');
|
||||||
header('location:'.e_BASE.'index.php');
|
e107::getRedirect()->redirect(e_BASE.'index.php');
|
||||||
|
// header('location:'.e_BASE.'index.php');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1055,31 +1051,11 @@ define('TIMEOFFSET', $e_deltaTime);
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
$sql->db_Mark_Time('(Start: Find/Load Theme)');
|
$sql->db_Mark_Time('(Start: Find/Load Theme)');
|
||||||
|
|
||||||
|
if(e_ADMIN_AREA) // Load admin phrases ASAP
|
||||||
// Work out which theme to use
|
|
||||||
//----------------------------
|
|
||||||
// The following files are assumed to use admin theme:
|
|
||||||
// 1. Any file in the admin directory (check for non-plugin added to avoid mismatches)
|
|
||||||
// 2. any plugin file starting with 'admin_'
|
|
||||||
// 3. any plugin file in a folder called admin/
|
|
||||||
// 4. any file that specifies $eplug_admin = TRUE;
|
|
||||||
//
|
|
||||||
// e_SELF has the full HTML path
|
|
||||||
$inAdminDir = FALSE;
|
|
||||||
$isPluginDir = strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE; // True if we're in a plugin
|
|
||||||
$e107Path = str_replace($e107->base_path, '', e_SELF); // Knock off the initial bits
|
|
||||||
if (
|
|
||||||
(!$isPluginDir && strpos($e107Path, $ADMIN_DIRECTORY) === 0 ) // Core admin directory
|
|
||||||
|| ($isPluginDir && (strpos(e_PAGE,'admin_') === 0 || strpos($e107Path, 'admin/') !== FALSE)) // Plugin admin file or directory
|
|
||||||
|| (varsettrue($eplug_admin) || defsettrue('ADMIN_AREA')) // Admin forced
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
$inAdminDir = TRUE;
|
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php');
|
||||||
// Load admin phrases ASAP
|
|
||||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php');
|
|
||||||
}
|
}
|
||||||
// This should avoid further checks - NOTE: used in js_manager.php
|
|
||||||
define('e_ADMIN_AREA', ($inAdminDir && !defsettrue('USER_AREA'))); //Force USER_AREA added
|
|
||||||
|
|
||||||
if(!defined('THEME'))
|
if(!defined('THEME'))
|
||||||
{
|
{
|
||||||
@@ -1177,7 +1153,7 @@ if(!isset($_E107['no_menus']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// here we USE the theme
|
// here we USE the theme
|
||||||
if($inAdminDir)
|
if(e_ADMIN_AREA)
|
||||||
{
|
{
|
||||||
if(file_exists(THEME.'admin_theme.php')&&(strpos(e_SELF.'?'.e_QUERY, $ADMIN_DIRECTORY.'menus.php?configure')===FALSE)) // no admin theme when previewing.
|
if(file_exists(THEME.'admin_theme.php')&&(strpos(e_SELF.'?'.e_QUERY, $ADMIN_DIRECTORY.'menus.php?configure')===FALSE)) // no admin theme when previewing.
|
||||||
{
|
{
|
||||||
@@ -1617,10 +1593,18 @@ function init_session()
|
|||||||
# - return boolean
|
# - return boolean
|
||||||
# - scope public
|
# - scope public
|
||||||
*/
|
*/
|
||||||
global $sql, $pref, $user_pref, $tp, $currentUser, $e107, $_E107, $eArrayStorage;
|
|
||||||
|
|
||||||
|
global $pref, $user_pref, $currentUser, $e107, $_E107;
|
||||||
|
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
$eArrayStorage = e107::getArrayStorage();
|
||||||
|
|
||||||
|
|
||||||
define('USERIP', $e107->getip());
|
define('USERIP', $e107->getip());
|
||||||
|
|
||||||
|
|
||||||
if(isset($_E107['cli']) && $_SERVER['argv'][1])
|
if(isset($_E107['cli']) && $_SERVER['argv'][1])
|
||||||
{
|
{
|
||||||
require_once(e_HANDLER.'cli_class.php');
|
require_once(e_HANDLER.'cli_class.php');
|
||||||
@@ -1657,6 +1641,8 @@ function init_session()
|
|||||||
|
|
||||||
if (empty($uid) || empty($upw))
|
if (empty($uid) || empty($upw))
|
||||||
{
|
{
|
||||||
|
//$_SESSION[] = e_SELF."?".e_QUERY;
|
||||||
|
|
||||||
cookie(e_COOKIE, '', (time() - 2592000));
|
cookie(e_COOKIE, '', (time() - 2592000));
|
||||||
$_SESSION[e_COOKIE] = "";
|
$_SESSION[e_COOKIE] = "";
|
||||||
session_destroy();
|
session_destroy();
|
||||||
@@ -1719,6 +1705,8 @@ function init_session()
|
|||||||
define('ADMINPERMS', $result['user_perms']);
|
define('ADMINPERMS', $result['user_perms']);
|
||||||
define('ADMINEMAIL', $result['user_email']);
|
define('ADMINEMAIL', $result['user_email']);
|
||||||
define('ADMINPWCHANGE', $result['user_pwchange']);
|
define('ADMINPWCHANGE', $result['user_pwchange']);
|
||||||
|
e107::getRedirect()->setPreviousUrl();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -9,12 +9,15 @@
|
|||||||
* Administration Area Authorization
|
* Administration Area Authorization
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/auth.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_admin/auth.php,v $
|
||||||
* $Revision: 1.13 $
|
* $Revision: 1.14 $
|
||||||
* $Date: 2009-11-18 01:04:24 $
|
* $Date: 2009-11-22 14:10:04 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT'))
|
||||||
|
{
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/* done in class2
|
/* done in class2
|
||||||
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
|
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
|
||||||
@@ -45,6 +48,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
$use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
|
$use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
|
||||||
|
|
||||||
if ($use_imagecode)
|
if ($use_imagecode)
|
||||||
{
|
{
|
||||||
require_once (e_HANDLER."secure_img_handler.php");
|
require_once (e_HANDLER."secure_img_handler.php");
|
||||||
@@ -65,13 +69,15 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once(e_HANDLER.'user_handler.php');
|
// require_once (e_HANDLER.'user_handler.php');
|
||||||
$row = $authresult = $obj->authcheck($_POST['authname'], $_POST['authpass'], varset($_POST['hashchallenge'], ''));
|
$row = $authresult = $obj->authcheck($_POST['authname'], $_POST['authpass'], varset($_POST['hashchallenge'], ''));
|
||||||
|
|
||||||
if ($row[0] == "authfail")
|
if ($row[0] == "authfail")
|
||||||
{
|
{
|
||||||
$admin_log->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", LAN_ROLL_LOG_11, "U: ".$tp->toDB($_POST['authname']), FALSE, LOG_TO_ROLLING);
|
$admin_log->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", LAN_ROLL_LOG_11, "U: ".$tp->toDB($_POST['authname']), FALSE, LOG_TO_ROLLING);
|
||||||
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
|
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
|
||||||
header("location: ../index.php");
|
// header("location: ../index.php");
|
||||||
|
e107::getRedirect()->redirect('../index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -98,32 +104,28 @@ else
|
|||||||
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
|
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
|
||||||
if (isset($user_logging_opts[USER_AUDIT_LOGIN]) && in_array(varset($pref['user_audit_class'], ''), $class_list))
|
if (isset($user_logging_opts[USER_AUDIT_LOGIN]) && in_array(varset($pref['user_audit_class'], ''), $class_list))
|
||||||
{ // Need to note in user audit trail
|
{ // Need to note in user audit trail
|
||||||
$admin_log->user_audit(USER_AUDIT_LOGIN,'', $user_id,$user_name);
|
e107::getAdminLog()->user_audit(USER_AUDIT_LOGIN, '', $user_id, $user_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$edata_li = array("user_id"=>$row['user_id'], "user_name"=>$row['user_name'], 'class_list'=>implode(',', $class_list));
|
$edata_li = array("user_id"=>$row['user_id'], "user_name"=>$row['user_name'], 'class_list'=>implode(',', $class_list));
|
||||||
$e_event->trigger("login", $edata_li);
|
|
||||||
|
|
||||||
if ($pref['user_tracking'] == "session")
|
e107::getEvent()->trigger("login", $edata_li);
|
||||||
{
|
|
||||||
$_SESSION[$pref['cookie_name']] = $cookieval;
|
session_set(e_COOKIE, $cookieval, (time() + 3600 * 24 * 30));
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cookie($pref['cookie_name'], $cookieval, (time()+3600 * 24 * 30));
|
|
||||||
}
|
|
||||||
echo "<script type='text/javascript'>document.location.href='admin.php'</script>\n";
|
echo "<script type='text/javascript'>document.location.href='admin.php'</script>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$e_sub_cat = 'logout';
|
$e_sub_cat = 'logout';
|
||||||
if(!defset('NO_HEADER')) require_once(e_ADMIN."header.php");
|
if (!defset('NO_HEADER'))
|
||||||
|
require_once (e_ADMIN."header.php");
|
||||||
|
|
||||||
if (ADMIN == FALSE)
|
if (ADMIN == FALSE)
|
||||||
{
|
{
|
||||||
$obj = new auth;
|
$obj = new auth;
|
||||||
$obj->authform();
|
$obj->authform();
|
||||||
if(!defset('NO_HEADER')) require_once(e_ADMIN."footer.php");
|
if (!defset('NO_HEADER'))
|
||||||
|
require_once (e_ADMIN."footer.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,25 +133,21 @@ else
|
|||||||
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
|
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||||
class auth
|
class auth
|
||||||
{
|
{
|
||||||
function authform()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
# Admin auth login
|
|
||||||
#
|
|
||||||
# - parameters none
|
|
||||||
# - return null
|
|
||||||
# - scope public
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin auth login
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
public function authform() //TODO Template
|
||||||
|
{
|
||||||
global $use_imagecode,$sec_img,$pref;
|
global $use_imagecode,$sec_img,$pref;
|
||||||
|
|
||||||
|
$frm = e107::getForm();
|
||||||
|
|
||||||
|
$incChap = (vartrue($pref['password_CHAP'], 0)) ? " onsubmit='hashLoginPassword(this)'" : "";
|
||||||
|
|
||||||
$text = "<div style='padding:20px;text-align:center'>
|
$text = "<div style='padding:20px;text-align:center'>
|
||||||
<form method='post' action='".e_SELF."'";
|
<form method='post' action='".e_SELF."' {$incChap} >
|
||||||
if (varsettrue($pref['password_CHAP'],0))
|
|
||||||
{
|
|
||||||
$text .= " onsubmit='hashLoginPassword(this)'";
|
|
||||||
}
|
|
||||||
$text .= ">\n
|
|
||||||
<table style='width:50%' class='fborder'>
|
<table style='width:50%' class='fborder'>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan='4' style='vertical-align:middle;width:65px'>".(file_exists(THEME."images/password.png") ? "<img src='".THEME_ABS."images/password.png' alt='' />\n" : "<img src='".e_IMAGE."generic/password.png' alt='' />\n")."</td>
|
<td rowspan='4' style='vertical-align:middle;width:65px'>".(file_exists(THEME."images/password.png") ? "<img src='".THEME_ABS."images/password.png' alt='' />\n" : "<img src='".e_IMAGE."generic/password.png' alt='' />\n")."</td>
|
||||||
@@ -160,10 +158,11 @@ class auth
|
|||||||
<tr>
|
<tr>
|
||||||
<td style='width:35%' class='forumheader3'>".ADLAN_90."</td>
|
<td style='width:35%' class='forumheader3'>".ADLAN_90."</td>
|
||||||
<td class='forumheader3' style='text-align:center'><input class='tbox' type='password' name='authpass' id='userpass' size='30' value='' maxlength='30' />\n";
|
<td class='forumheader3' style='text-align:center'><input class='tbox' type='password' name='authpass' id='userpass' size='30' value='' maxlength='30' />\n";
|
||||||
if (isset($_SESSION['challenge']) && varset($pref['password_CHAP'],0)) $text .= "<input type='hidden' name='hashchallenge' id='hashchallenge' value='{$_SESSION['challenge']}' />\n\n";
|
|
||||||
$text .= "</td>
|
if (isset($_SESSION['challenge']) && varset($pref['password_CHAP'], 0))
|
||||||
</tr>
|
|
||||||
";
|
$text .= "<input type='hidden' name='hashchallenge' id='hashchallenge' value='{$_SESSION['challenge']}' />\n\n";
|
||||||
|
$text .= "</td></tr>\n";
|
||||||
|
|
||||||
if ($use_imagecode)
|
if ($use_imagecode)
|
||||||
{
|
{
|
||||||
@@ -171,46 +170,49 @@ class auth
|
|||||||
<tr>
|
<tr>
|
||||||
<td style='width:35%' class='forumheader3'>".ADLAN_152."</td>
|
<td style='width:35%' class='forumheader3'>".ADLAN_152."</td>
|
||||||
<td style='text-align:center'>
|
<td style='text-align:center'>
|
||||||
<input type='hidden' name='rand_num' value='".$sec_img->random_number."' />".
|
<input type='hidden' name='rand_num' value='".$sec_img->random_number."' />".$sec_img->r_image()."<br /><input class='tbox' type='text' name='code_verify' size='15' maxlength='20' /></td>
|
||||||
$sec_img->r_image().
|
|
||||||
"<br /><input class='tbox' type='text' name='code_verify' size='15' maxlength='20' /></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan='2' style='text-align:center' class='forumheader'>
|
<td colspan='2' class='forumheader center'>"
|
||||||
|
.$frm->admin_button('authsubmit',ADLAN_91).
|
||||||
<input class='button' type='submit' name='authsubmit' value='".ADLAN_91."' />
|
"</td>
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
$au = new e107table;
|
e107::getRender()->tablerender(ADLAN_92, $text);
|
||||||
$au->tablerender(ADLAN_92, $text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function authcheck($authname, $authpass, $authresponse = '')
|
|
||||||
{
|
/**
|
||||||
/*
|
* Admin auth check
|
||||||
# Admin auth check
|
* @param string $authname, entered name
|
||||||
# - parameter #1: string $authname, entered name
|
* @param string $authpass, entered pass
|
||||||
# - parameter #2: string $authpass, entered pass
|
* @param object $authresponse [optional]
|
||||||
# - return boolean if fail, else result array
|
* @return boolean if fail, else result array
|
||||||
# - scope public
|
|
||||||
*/
|
*/
|
||||||
global $tp, $pref;
|
public function authcheck($authname, $authpass, $authresponse = '')
|
||||||
|
{
|
||||||
|
|
||||||
|
global $pref;
|
||||||
|
|
||||||
|
$tp = e107::getParser();
|
||||||
$sql_auth = e107::getDb('sql_auth');
|
$sql_auth = e107::getDb('sql_auth');
|
||||||
|
$user_info = e107::getSession();
|
||||||
$reason = '';
|
$reason = '';
|
||||||
$user_info = new UserHandler;
|
|
||||||
|
|
||||||
$authname = $tp->toDB(preg_replace("/\sOR\s|\=|\#/", "", trim($authname)));
|
$authname = $tp->toDB(preg_replace("/\sOR\s|\=|\#/", "", trim($authname)));
|
||||||
$authpass = trim($authpass);
|
$authpass = trim($authpass);
|
||||||
if (($authpass == '') || ($authname == '')) $reason = 'np';
|
|
||||||
if (strlen($authname) > varset($pref['loginname_maxlength'],30)) $reason = 'lu';
|
if (($authpass == '') || ($authname == ''))
|
||||||
|
$reason = 'np';
|
||||||
|
if (strlen($authname) > varset($pref['loginname_maxlength'], 30))
|
||||||
|
$reason = 'lu';
|
||||||
|
|
||||||
if (!$reason)
|
if (!$reason)
|
||||||
{
|
{
|
||||||
@@ -228,8 +230,8 @@ class auth
|
|||||||
$reason = 'iu';
|
$reason = 'iu';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$reason && ($row['user_id']))
|
if (!$reason && ($row['user_id'])) // Can validate password
|
||||||
{ // Can validate password
|
{
|
||||||
if (($authresponse && isset($_SESSION['challenge'])) && ($authresponse != $_SESSION['challenge']))
|
if (($authresponse && isset($_SESSION['challenge'])) && ($authresponse != $_SESSION['challenge']))
|
||||||
{ // Verify using CHAP (can't handle login by email address - only loginname - although with this code it does still work if the password is stored unsalted)
|
{ // Verify using CHAP (can't handle login by email address - only loginname - although with this code it does still work if the password is stored unsalted)
|
||||||
if (($pass_result = $user_info->CheckCHAP($_SESSION['challenge'], $authresponse, $authname, $row['user_password'])) !== PASSWORD_INVALID)
|
if (($pass_result = $user_info->CheckCHAP($_SESSION['challenge'], $authresponse, $authname, $row['user_password'])) !== PASSWORD_INVALID)
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org/).
|
| GNU General Public License (http://gnu.org/).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/cron.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/cron.php,v $
|
||||||
| $Revision: 1.22 $
|
| $Revision: 1.23 $
|
||||||
| $Date: 2009-11-21 22:26:15 $
|
| $Date: 2009-11-22 14:10:05 $
|
||||||
| $Author: e107steved $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -269,8 +269,7 @@ function setCronPwd()
|
|||||||
{
|
{
|
||||||
global $pref;
|
global $pref;
|
||||||
|
|
||||||
require_once (e_HANDLER.'user_handler.php');
|
$userMethods = e107::getSession();
|
||||||
$userMethods = new UserHandler;
|
|
||||||
$newpwd = $userMethods->generateRandomString('*^*#.**^*');
|
$newpwd = $userMethods->generateRandomString('*^*#.**^*');
|
||||||
$newpwd = sha1($newpwd.time());
|
$newpwd = sha1($newpwd.time());
|
||||||
$pref['e_cron_pwd'] = $newpwd;
|
$pref['e_cron_pwd'] = $newpwd;
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
* Image Administration Area
|
* Image Administration Area
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/image.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_admin/image.php,v $
|
||||||
* $Revision: 1.37 $
|
* $Revision: 1.38 $
|
||||||
* $Date: 2009-11-18 14:46:28 $
|
* $Date: 2009-11-22 14:10:05 $
|
||||||
* $Author: secretr $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
require_once("../class2.php");
|
require_once("../class2.php");
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
* Administration Area - Update Admin
|
* Administration Area - Update Admin
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/updateadmin.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_admin/updateadmin.php,v $
|
||||||
* $Revision: 1.8 $
|
* $Revision: 1.9 $
|
||||||
* $Date: 2009-11-18 01:04:26 $
|
* $Date: 2009-11-22 14:10:06 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -23,9 +23,9 @@ $e_sub_cat = 'admin_pass';
|
|||||||
|
|
||||||
require_once(e_ADMIN.'auth.php');
|
require_once(e_ADMIN.'auth.php');
|
||||||
require_once(e_HANDLER.'message_handler.php');
|
require_once(e_HANDLER.'message_handler.php');
|
||||||
require_once(e_HANDLER.'user_handler.php');
|
// require_once(e_HANDLER.'user_handler.php'); //use e107::getSession() instead.
|
||||||
require_once(e_HANDLER.'validator_class.php');
|
require_once(e_HANDLER.'validator_class.php');
|
||||||
$userMethods = new UserHandler;
|
$userMethods = e107::getSession();
|
||||||
$emessage = &eMessage::getInstance();
|
$emessage = &eMessage::getInstance();
|
||||||
|
|
||||||
if (isset($_POST['update_settings']))
|
if (isset($_POST['update_settings']))
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
* Administration Area - Users
|
* Administration Area - Users
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
|
||||||
* $Revision: 1.69 $
|
* $Revision: 1.70 $
|
||||||
* $Date: 2009-11-18 01:04:26 $
|
* $Date: 2009-11-22 14:10:06 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -78,11 +78,11 @@ require_once (e_HANDLER.'form_handler.php');
|
|||||||
require_once (e_HANDLER.'userclass_class.php');
|
require_once (e_HANDLER.'userclass_class.php');
|
||||||
include_once (e_HANDLER.'user_extended_class.php');
|
include_once (e_HANDLER.'user_extended_class.php');
|
||||||
require_once (e_HANDLER.'validator_class.php');
|
require_once (e_HANDLER.'validator_class.php');
|
||||||
require_once (e_HANDLER.'user_handler.php');
|
// require_once (e_HANDLER.'user_handler.php');
|
||||||
// $userMethods = new UserHandler;
|
// $userMethods = new UserHandler;
|
||||||
// $colList = $userMethods->getNiceNames(TRUE);
|
// $colList = $userMethods->getNiceNames(TRUE);
|
||||||
$ue = new e107_user_extended;
|
$ue = new e107_user_extended;
|
||||||
$userMethods = new UserHandler;
|
$userMethods = e107::getSession();
|
||||||
$user_data = array();
|
$user_data = array();
|
||||||
$frm = new e_form;
|
$frm = new e_form;
|
||||||
$rs = new form;
|
$rs = new form;
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
* e107 Main
|
* e107 Main
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
||||||
* $Revision: 1.80 $
|
* $Revision: 1.81 $
|
||||||
* $Date: 2009-11-21 11:36:10 $
|
* $Date: 2009-11-22 14:10:07 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -140,7 +140,9 @@ class e107
|
|||||||
'comment' => '{e_HANDLER}comment_class.php',
|
'comment' => '{e_HANDLER}comment_class.php',
|
||||||
'e107_user_extended' => '{e_HANDLER}user_extended_class.php',
|
'e107_user_extended' => '{e_HANDLER}user_extended_class.php',
|
||||||
'e_userperms' => '{e_HANDLER}user_handler.php',
|
'e_userperms' => '{e_HANDLER}user_handler.php',
|
||||||
'sitelinks' => '{e_HANDLER}sitelinks_class.php'
|
'UserHandler' => '{e_HANDLER}user_handler.php',
|
||||||
|
'sitelinks' => '{e_HANDLER}sitelinks_class.php',
|
||||||
|
'redirection' => '{e_HANDLER}redirection_class.php'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -216,6 +218,8 @@ class e107
|
|||||||
{
|
{
|
||||||
$this->e107_dirs = $e107_paths;
|
$this->e107_dirs = $e107_paths;
|
||||||
$this->set_paths();
|
$this->set_paths();
|
||||||
|
$this->set_base_path();
|
||||||
|
$this->set_eUrls();
|
||||||
$this->file_path = $this->fix_windows_paths($e107_root_path)."/";
|
$this->file_path = $this->fix_windows_paths($e107_root_path)."/";
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
@@ -651,6 +655,8 @@ class e107
|
|||||||
return self::getSingleton('e_parse', e_HANDLER.'e_parse_class.php');
|
return self::getSingleton('e_parse', e_HANDLER.'e_parse_class.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve sc parser singleton object
|
* Retrieve sc parser singleton object
|
||||||
*
|
*
|
||||||
@@ -700,6 +706,16 @@ class e107
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve redirection singleton object
|
||||||
|
*
|
||||||
|
* @return redirection
|
||||||
|
*/
|
||||||
|
public static function getRedirect()
|
||||||
|
{
|
||||||
|
return self::getSingleton('redirection', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve sitelinks singleton object
|
* Retrieve sitelinks singleton object
|
||||||
@@ -732,6 +748,16 @@ class e107
|
|||||||
return self::getSingleton('e107_event', true);
|
return self::getSingleton('e107_event', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve user-session singleton object
|
||||||
|
*
|
||||||
|
* @return e107_event
|
||||||
|
*/
|
||||||
|
public static function getSession()
|
||||||
|
{
|
||||||
|
return self::getSingleton('UserHandler', true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve array storage singleton object
|
* Retrieve array storage singleton object
|
||||||
*
|
*
|
||||||
@@ -1230,6 +1256,9 @@ class e107
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set all environment vars and constants
|
* Set all environment vars and constants
|
||||||
* FIXME - remove globals
|
* FIXME - remove globals
|
||||||
@@ -1399,6 +1428,59 @@ class e107
|
|||||||
return $fixed_path;
|
return $fixed_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define e_PAGE, e_SELF, e_ADMIN_AREA and USER_AREA;
|
||||||
|
* The following files are assumed to use admin theme:
|
||||||
|
* 1. Any file in the admin directory (check for non-plugin added to avoid mismatches)
|
||||||
|
* 2. any plugin file starting with 'admin_'
|
||||||
|
* 3. any plugin file in a folder called admin/
|
||||||
|
* 4. any file that specifies $eplug_admin = TRUE;
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public function set_eUrls()
|
||||||
|
{
|
||||||
|
global $PLUGINS_DIRECTORY,$ADMIN_DIRECTORY;
|
||||||
|
|
||||||
|
$pref = $this->getConfig()->getPref();
|
||||||
|
$page = substr(strrchr($_SERVER['PHP_SELF'], '/'), 1);
|
||||||
|
|
||||||
|
define('e_PAGE', $page);
|
||||||
|
define('e_SELF', ($pref['ssl_enabled'] == '1' ? 'https://'.$_SERVER['HTTP_HOST'] : 'http://'.$_SERVER['HTTP_HOST']) . ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']));
|
||||||
|
|
||||||
|
define('e_SIGNUP', e_BASE.(file_exists(e_BASE.'customsignup.php') ? 'customsignup.php' : 'signup.php'));
|
||||||
|
define('e_LOGIN', e_BASE.(file_exists(e_BASE.'customlogin.php') ? 'customlogin.php' : 'login.php'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// e_SELF has the full HTML path
|
||||||
|
$inAdminDir = FALSE;
|
||||||
|
$isPluginDir = strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE; // True if we're in a plugin
|
||||||
|
$e107Path = str_replace($this->base_path, '', e_SELF); // Knock off the initial bits
|
||||||
|
|
||||||
|
if (
|
||||||
|
(!$isPluginDir && strpos($e107Path, $ADMIN_DIRECTORY) === 0 ) // Core admin directory
|
||||||
|
|| ($isPluginDir && (strpos(e_PAGE,'admin_') === 0 || strpos($e107Path, 'admin/') !== FALSE)) // Plugin admin file or directory
|
||||||
|
|| (varsettrue($eplug_admin) || defsettrue('ADMIN_AREA')) // Admin forced
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$inAdminDir = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This should avoid further checks - NOTE: used in js_manager.php
|
||||||
|
define('e_ADMIN_AREA', ($inAdminDir && !defsettrue('USER_AREA'))); //Force USER_AREA added
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if current user is banned
|
* Check if current user is banned
|
||||||
*
|
*
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
* e107 Main
|
* e107 Main
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $
|
||||||
* $Revision: 1.30 $
|
* $Revision: 1.31 $
|
||||||
* $Date: 2009-11-18 01:04:43 $
|
* $Date: 2009-11-22 14:10:07 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
|
||||||
require_once(e_HANDLER.'user_handler.php');
|
// require_once(e_HANDLER.'user_handler.php'); //shouldn't be necessary
|
||||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_login.php');
|
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_login.php');
|
||||||
|
|
||||||
define ('LOGIN_TRY_OTHER', 2); // Try some other authentication method
|
define ('LOGIN_TRY_OTHER', 2); // Try some other authentication method
|
||||||
@@ -73,6 +73,9 @@ class userlogin
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tp = e107::getParser();
|
||||||
|
$sql = e107::getDb();
|
||||||
|
|
||||||
$this->e107 = e107::getInstance();
|
$this->e107 = e107::getInstance();
|
||||||
$this->userIP = $this->e107->getip();
|
$this->userIP = $this->e107->getip();
|
||||||
|
|
||||||
@@ -264,7 +267,15 @@ class userlogin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
header("Location: ".$redir);
|
|
||||||
|
$redirPrev = e107::getRedirect()->getPreviousUrl();
|
||||||
|
|
||||||
|
if($redirPrev)
|
||||||
|
{
|
||||||
|
e107::getRedirect()->redirect($redirPrev);
|
||||||
|
}
|
||||||
|
|
||||||
|
e107::getRedirect()->redirect($redir);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +345,7 @@ class userlogin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now check password
|
// Now check password
|
||||||
$this->userMethods = new UserHandler;
|
$this->userMethods = e107::getSession();
|
||||||
if ($forceLogin)
|
if ($forceLogin)
|
||||||
{
|
{
|
||||||
if (md5($this->userData['user_name'].$this->userData['user_password'].$this->userData['user_join']) != $userpass)
|
if (md5($this->userData['user_name'].$this->userData['user_password'].$this->userData['user_join']) != $userpass)
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/redirection_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/redirection_class.php,v $
|
||||||
| $Revision: 1.7 $
|
| $Revision: 1.8 $
|
||||||
| $Date: 2009-11-18 01:04:43 $
|
| $Date: 2009-11-22 14:10:07 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -42,6 +42,9 @@ class redirection
|
|||||||
*/
|
*/
|
||||||
protected $page_exceptions = array();
|
protected $page_exceptions = array();
|
||||||
|
|
||||||
|
|
||||||
|
protected $query_exceptions = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage Member-Only Mode.
|
* Manage Member-Only Mode.
|
||||||
*
|
*
|
||||||
@@ -51,8 +54,61 @@ class redirection
|
|||||||
{
|
{
|
||||||
$this->self_exceptions = array(SITEURL.e_SIGNUP, SITEURL.'index.php', SITEURL.'fpw.php', SITEURL.e_LOGIN, SITEURL.'membersonly.php');
|
$this->self_exceptions = array(SITEURL.e_SIGNUP, SITEURL.'index.php', SITEURL.'fpw.php', SITEURL.e_LOGIN, SITEURL.'membersonly.php');
|
||||||
$this->page_exceptions = array('e_ajax.php', 'e_js.php', 'e_jslib.php', 'sitedown.php');
|
$this->page_exceptions = array('e_ajax.php', 'e_js.php', 'e_jslib.php', 'sitedown.php');
|
||||||
|
$this->query_exceptions = array('logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store the current URL in a cookie for 5 minutes so we can return to it after being logged out.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
function setPreviousUrl()
|
||||||
|
{
|
||||||
|
if(in_array(e_SELF, $this->self_exceptions))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(in_array(e_PAGE, $this->page_exceptions))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(in_array(e_QUERY, $this->query_exceptions))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$self = (e_QUERY) ? e_SELF."?".e_QUERY : e_SELF;
|
||||||
|
|
||||||
|
session_set(e_COOKIE.'_previousUrl',$self ,(time()+300));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the URL the admin was on, prior to being logged-out.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public function getPreviousUrl()
|
||||||
|
{
|
||||||
|
return $this->getCookie('previousUrl');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function getCookie($name) //TODO move to e107_class or a new user l class.
|
||||||
|
{
|
||||||
|
$cookiename = e_COOKIE."_".$name;
|
||||||
|
|
||||||
|
if(vartrue($_SESSION[$cookiename]))
|
||||||
|
{
|
||||||
|
return $_SESSION[$cookiename];
|
||||||
|
}
|
||||||
|
elseif(vartrue($_COOKIE[$cookiename]))
|
||||||
|
{
|
||||||
|
return $_COOKIE[$cookiename];
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform re-direction when Maintenance Mode is active.
|
* Perform re-direction when Maintenance Mode is active.
|
||||||
*
|
*
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/sitelinks_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/sitelinks_class.php,v $
|
||||||
* $Revision: 1.24 $
|
* $Revision: 1.25 $
|
||||||
* $Date: 2009-11-21 11:36:10 $
|
* $Date: 2009-11-22 14:10:07 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ class sitelinks
|
|||||||
foreach ($this->eLinkList['head_menu'] as $key => $link){
|
foreach ($this->eLinkList['head_menu'] as $key => $link){
|
||||||
$main_linkid = "sub_".$link['link_id'];
|
$main_linkid = "sub_".$link['link_id'];
|
||||||
|
|
||||||
$link['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !$style['linkmainonly'] && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? TRUE : FALSE;
|
$link['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !vartrue($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? TRUE : FALSE;
|
||||||
|
|
||||||
$render_link[$key] = $this->makeLink($link,'', $style, $css_class);
|
$render_link[$key] = $this->makeLink($link,'', $style, $css_class);
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ class sitelinks
|
|||||||
$tmp = explode('.', $linkInfo['link_name'], 3);
|
$tmp = explode('.', $linkInfo['link_name'], 3);
|
||||||
$linkInfo['link_name'] = $tmp[2];
|
$linkInfo['link_name'] = $tmp[2];
|
||||||
}
|
}
|
||||||
$indent = ($style['linkdisplay'] != 3) ? $style['subindent'] : "";
|
$indent = ($style['linkdisplay'] != 3) ? varset($style['subindent']) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert any {e_XXX} to absolute URLs (relative ones sometimes get broken by adding e_HTTP at the front)
|
// Convert any {e_XXX} to absolute URLs (relative ones sometimes get broken by adding e_HTTP at the front)
|
||||||
|
@@ -15,7 +15,8 @@ if (!defined('e107_INIT'))
|
|||||||
if (USER_AREA == TRUE)
|
if (USER_AREA == TRUE)
|
||||||
{
|
{
|
||||||
//TODO use popup window for 'invite friends'.
|
//TODO use popup window for 'invite friends'.
|
||||||
$CUSTOMPAGES = array_push(explode(' ', $CUSTOMPAGES), ' facebook.php');
|
// $CUSTOMPAGES = array_push(explode(' ', $CUSTOMPAGES), ' facebook.php');
|
||||||
|
|
||||||
$fb = e107::getSingleton('e_facebook',e_PLUGIN.'facebook/facebook_function.php');
|
$fb = e107::getSingleton('e_facebook',e_PLUGIN.'facebook/facebook_function.php');
|
||||||
|
|
||||||
include_once (e_PLUGIN.'facebook/facebook_function.php');
|
include_once (e_PLUGIN.'facebook/facebook_function.php');
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
//error_reporting(E_ALL);
|
//error_reporting(E_ALL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (e_ADMIN_AREA !== TRUE)
|
if (e_ADMIN_AREA !== TRUE)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -20,7 +18,7 @@ if (e_ADMIN_AREA !== TRUE)
|
|||||||
prevent_cache_headers();
|
prevent_cache_headers();
|
||||||
}
|
}
|
||||||
|
|
||||||
define(XMLNS, "xmlns:fb='http://www.facebook.com/2008/fbml'");
|
define('XMLNS', "xmlns:fb='http://www.facebook.com/2008/fbml'");
|
||||||
|
|
||||||
global $pref;
|
global $pref;
|
||||||
|
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/facebook/facebook_function.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/facebook/facebook_function.php,v $
|
||||||
* $Revision: 1.15 $
|
* $Revision: 1.16 $
|
||||||
* $Date: 2009-11-18 21:18:21 $
|
* $Date: 2009-11-22 14:10:08 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -821,7 +821,7 @@ class e_facebook
|
|||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if($fbid)
|
if(vartrue($fbid))
|
||||||
{
|
{
|
||||||
// echo "fbid=".print_a($fbid);
|
// echo "fbid=".print_a($fbid);
|
||||||
return $fbid[0]['uid'];
|
return $fbid[0]['uid'];
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
* Plugin configuration module - gsitemap
|
* Plugin configuration module - gsitemap
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/gsitemap/e_cron.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/gsitemap/e_cron.php,v $
|
||||||
* $Revision: 1.5 $
|
* $Revision: 1.6 $
|
||||||
* $Date: 2009-11-18 01:05:37 $
|
* $Date: 2009-11-22 14:10:09 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -29,7 +29,7 @@ class gsitemap_cron // include plugin-folder in the name.
|
|||||||
global $pref;
|
global $pref;
|
||||||
|
|
||||||
$cron = array();
|
$cron = array();
|
||||||
/*
|
|
||||||
$cron[] = array(
|
$cron[] = array(
|
||||||
'name' => "Update Records",
|
'name' => "Update Records",
|
||||||
'function' => "myfunction",
|
'function' => "myfunction",
|
||||||
@@ -40,7 +40,7 @@ class gsitemap_cron // include plugin-folder in the name.
|
|||||||
'name' => "Test Email",
|
'name' => "Test Email",
|
||||||
'function' => "sendEmail",
|
'function' => "sendEmail",
|
||||||
'description' => "Sends a test email to ".$pref['siteadminemail']
|
'description' => "Sends a test email to ".$pref['siteadminemail']
|
||||||
); */
|
);
|
||||||
|
|
||||||
return $cron;
|
return $cron;
|
||||||
}
|
}
|
||||||
|
17
fpw.php
17
fpw.php
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/fpw.php,v $
|
| $Source: /cvs_backup/e107_0.8/fpw.php,v $
|
||||||
| $Revision: 1.10 $
|
| $Revision: 1.11 $
|
||||||
| $Date: 2009-11-18 01:04:24 $
|
| $Date: 2009-11-22 14:10:02 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -42,21 +42,14 @@ if ($pref['membersonly_enabled'])
|
|||||||
{
|
{
|
||||||
if (!$FPW_TABLE_HEADER)
|
if (!$FPW_TABLE_HEADER)
|
||||||
{
|
{
|
||||||
if (file_exists(THEME."fpw_template.php"))
|
require_once (e107::coreTemplatePath('fpw')); //correct way to load a core template.
|
||||||
{
|
|
||||||
require_once(THEME."fpw_template.php");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
require_once(e_BASE.$THEMES_DIRECTORY."templates/fpw_template.php");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$HEADER = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE_HEADER);
|
$HEADER = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE_HEADER);
|
||||||
$FOOTER = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE_FOOTER);
|
$FOOTER = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE_FOOTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once(e_HANDLER.'user_handler.php');
|
// require_once(e_HANDLER.'user_handler.php');
|
||||||
$user_info = new UserHandler;
|
$user_info = e107::getSession();
|
||||||
|
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
|
||||||
|
6
page.php
6
page.php
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/page.php,v $
|
| $Source: /cvs_backup/e107_0.8/page.php,v $
|
||||||
| $Revision: 1.22 $
|
| $Revision: 1.23 $
|
||||||
| $Date: 2009-11-18 01:04:24 $
|
| $Date: 2009-11-22 14:10:03 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
@@ -58,12 +58,14 @@ else
|
|||||||
$e107_core_custom_pages = $page -> showPage();
|
$e107_core_custom_pages = $page -> showPage();
|
||||||
define("e_PAGETITLE", $e107_core_custom_pages['title']);
|
define("e_PAGETITLE", $e107_core_custom_pages['title']);
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
|
||||||
if ($e107_core_custom_pages['err']) // Need to display error block after header defined
|
if ($e107_core_custom_pages['err']) // Need to display error block after header defined
|
||||||
{
|
{
|
||||||
$ns -> tablerender($e107_core_custom_pages['title'], $e107_core_custom_pages['text'],"cpage");
|
$ns -> tablerender($e107_core_custom_pages['title'], $e107_core_custom_pages['text'],"cpage");
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($e107_core_custom_pages['cachecontrol'] == TRUE)
|
if ($e107_core_custom_pages['cachecontrol'] == TRUE)
|
||||||
{
|
{
|
||||||
ob_start();
|
ob_start();
|
||||||
|
27
signup.php
27
signup.php
@@ -9,9 +9,9 @@
|
|||||||
* User signup
|
* User signup
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/signup.php,v $
|
* $Source: /cvs_backup/e107_0.8/signup.php,v $
|
||||||
* $Revision: 1.42 $
|
* $Revision: 1.43 $
|
||||||
* $Date: 2009-11-18 20:45:20 $
|
* $Date: 2009-11-22 14:10:03 $
|
||||||
* $Author: e107steved $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -35,18 +35,11 @@ $usere = new e107_user_extended;
|
|||||||
require_once(e_HANDLER.'calendar/calendar_class.php');
|
require_once(e_HANDLER.'calendar/calendar_class.php');
|
||||||
$cal = new DHTML_Calendar(true);
|
$cal = new DHTML_Calendar(true);
|
||||||
require_once(e_HANDLER.'validator_class.php');
|
require_once(e_HANDLER.'validator_class.php');
|
||||||
require_once(e_HANDLER.'user_handler.php');
|
// require_once(e_HANDLER.'user_handler.php');
|
||||||
$userMethods = new UserHandler;
|
$userMethods = e107::getSession();
|
||||||
$userMethods->deleteExpired(); // Delete time-expired partial registrations
|
$userMethods->deleteExpired(); // Delete time-expired partial registrations
|
||||||
|
|
||||||
if (is_readable(THEME.'signup_template.php'))
|
require_once(e107::coreTemplatePath('signup')); //correct way to load a core template.
|
||||||
{
|
|
||||||
require_once(THEME.'signup_template.php');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
require_once(e_THEME.'templates/signup_template.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
include_once(e_FILE.'shortcode/batch/signup_shortcodes.php');
|
include_once(e_FILE.'shortcode/batch/signup_shortcodes.php');
|
||||||
|
|
||||||
@@ -262,9 +255,13 @@ if($signup_imagecode)
|
|||||||
$sec_img = new secure_image;
|
$sec_img = new secure_image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (USER || ($pref['user_reg'] == 0) || ($pref['auth_method'] != 'e107'))
|
if (USER || ($pref['user_reg'] == 0) || (vartrue($pref['auth_method'],'e107') != 'e107'))
|
||||||
{
|
{
|
||||||
header('location: '.e_HTTP.'index.php');
|
//header('location: '.e_HTTP.'index.php');
|
||||||
|
var_dump(USER);
|
||||||
|
var_dump($pref['user_reg']);
|
||||||
|
var_dump($pref['auth_method']);
|
||||||
|
echo "hello";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
* User settings modify
|
* User settings modify
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/usersettings.php,v $
|
* $Source: /cvs_backup/e107_0.8/usersettings.php,v $
|
||||||
* $Revision: 1.44 $
|
* $Revision: 1.45 $
|
||||||
* $Date: 2009-11-18 20:45:20 $
|
* $Date: 2009-11-22 14:10:03 $
|
||||||
* $Author: e107steved $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
@@ -49,20 +49,14 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_usersettings.php');
|
|||||||
|
|
||||||
require_once (e_HANDLER.'ren_help.php');
|
require_once (e_HANDLER.'ren_help.php');
|
||||||
require_once (e_HANDLER.'user_extended_class.php');
|
require_once (e_HANDLER.'user_extended_class.php');
|
||||||
require_once (e_HANDLER.'user_handler.php');
|
// require_once (e_HANDLER.'user_handler.php');
|
||||||
require_once(e_HANDLER.'validator_class.php');
|
require_once(e_HANDLER.'validator_class.php');
|
||||||
$ue = new e107_user_extended;
|
$ue = new e107_user_extended;
|
||||||
$userMethods = new UserHandler;
|
|
||||||
require_once (e_HANDLER.'ren_help.php');
|
|
||||||
|
|
||||||
if (is_readable(THEME.'usersettings_template.php'))
|
$userMethods = e107::getSession();
|
||||||
{
|
|
||||||
include_once (THEME.'usersettings_template.php');
|
require_once (e_HANDLER.'ren_help.php');
|
||||||
}
|
include_once (e107::coreTemplatePath('usersettings')); //correct way to load a core template.
|
||||||
else
|
|
||||||
{
|
|
||||||
include_once (e_THEME.'templates/usersettings_template.php');
|
|
||||||
}
|
|
||||||
include_once (e_FILE.'shortcode/batch/usersettings_shortcodes.php');
|
include_once (e_FILE.'shortcode/batch/usersettings_shortcodes.php');
|
||||||
|
|
||||||
require_once (e_HANDLER.'calendar/calendar_class.php');
|
require_once (e_HANDLER.'calendar/calendar_class.php');
|
||||||
|
Reference in New Issue
Block a user