diff --git a/e107_admin/users.php b/e107_admin/users.php index 0ef4c94a4..80c9b1d3e 100644 --- a/e107_admin/users.php +++ b/e107_admin/users.php @@ -10,7 +10,12 @@ * Administration Area - Users * */ -require_once ('../class2.php'); + +if (!defined('e107_INIT')) +{ + require_once("../class2.php"); +} + e107::coreLan('user'); e107::coreLan('users', true); diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php index 55b8a911c..eaac60c3f 100644 --- a/e107_core/shortcodes/batch/user_shortcodes.php +++ b/e107_core/shortcodes/batch/user_shortcodes.php @@ -510,7 +510,11 @@ class user_shortcodes extends e_shortcode } else if(ADMIN && getperms("4") && !$this->var['user_admin']) { - return " $this->var['user_id'], 'name' => $this->var['user_name']))."'>".LAN_USER_39.""; + $editUrl = e_ADMIN_ABS."users.php?mode=main&action=edit&id=".$this->var['user_id']; + + return "".LAN_USER_39.""; + + // return " $this->var['user_id'], 'name' => $this->var['user_name']))."'>".LAN_USER_39.""; } } diff --git a/e107_core/url/user/rewrite_url.php b/e107_core/url/user/rewrite_url.php index c0de27a51..06635f272 100644 --- a/e107_core/url/user/rewrite_url.php +++ b/e107_core/url/user/rewrite_url.php @@ -41,10 +41,10 @@ class core_user_rewrite_url extends eUrlConfig // Regex involved next //'' => array('profile/view', 'legacyQuery' => 'id.{id}'), - 'edit/' => array('profile/edit', 'legacy' => '{e_BASE}usersettings.php', 'legacyQuery' => '{id}'), + // 'edit/' => array('profile/edit', 'legacy' => '{e_ADMIN}users.php', 'legacyQuery' => 'mode=main&action=edit&id={id}'), // Named requests - important to be in the end in this order! - 'edit/' => array('profile/edit', 'legacy' => '{e_BASE}usersettings.php', 'legacyQuery' => '{id}', 'parseCallback' => 'idByName'), + // 'edit/' => array('profile/edit','legacy' => '{e_ADMIN}users.php', 'legacyQuery' => 'mode=main&action=edit&id={id}', 'parseCallback' => 'idByName'), // Last one - close to catch all! '' => array('profile/view', 'legacyQuery' => 'id.{id}', 'parseCallback' => 'idByName'), ) diff --git a/e107_core/url/user/url.php b/e107_core/url/user/url.php index 0700f8053..b40c391d2 100644 --- a/e107_core/url/user/url.php +++ b/e107_core/url/user/url.php @@ -68,7 +68,7 @@ class core_user_url extends eUrlConfig break; case 'edit': - $url = 'usersettings.php?'.$params['id']; + $url = e_ADMIN_ABS."user.php?mode=main&action=edit&id=".$params['id'];// 'usersettings.php?'.$params['id']; break; } } diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 9863cfbd0..61b6b8bad 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -3441,7 +3441,11 @@ class e107 } - define('e_ADMIN_AREA', ($inAdminDir && !deftrue('USER_AREA'))); + if(!defined('e_ADMIN_AREA')) + { + define('e_ADMIN_AREA', ($inAdminDir && !deftrue('USER_AREA'))); + } + define('ADMINDIR', $ADMIN_DIRECTORY); define('SITEURLBASE', $this->HTTP_SCHEME.'://'.$_SERVER['HTTP_HOST']); diff --git a/usersettings.php b/usersettings.php index f95b6c85b..f56db436c 100644 --- a/usersettings.php +++ b/usersettings.php @@ -21,75 +21,11 @@ Admin log events: USET_01 - admin changed user data */ -/* -if(preg_match('/^\/(.*?)\/(usersettings\.php|\/edit)(\?|\/)(\d+)$/i', $_SERVER['REQUEST_URI'], $_usersettings_matches)) -{ - $eplug_admin = TRUE; -} -*/ require_once ('class2.php'); // TODO - Remove all the adminEdit stuff. -/* -class usersetting_admin extends e_admin_dispatcher -{ - - protected $modes = array( - 'main' => array( - 'controller' => 'usersettings_admin_ui', - 'path' => null, - 'ui' => null, - 'uipath' => null, - //'perm' => '0', - ) - ); - - - protected $adminMenu = array( - 'main/list' => array('caption'=> LAN_MANAGE, 'perm' => '0', 'url' => '{e_ADMIN}users.php'), - 'main/add' => array('caption'=> LAN_USER_QUICKADD, 'perm' => '4|U0|U1', 'url' => '{e_ADMIN}users.php'), - 'main/prefs' => array('caption'=> LAN_OPTIONS, 'perm' => '4|U2', 'url' => '{e_ADMIN}users.php'), - 'main/ranks' => array('caption'=> LAN_USER_RANKS, 'perm' => '4|U3', 'url' => '{e_ADMIN}users.php') - ); - - protected $adminMenuAliases = array( - 'main/edit' => 'main/list', - 'main/admin' => 'main/list', - 'main/userclass'=> 'main/list', - 'main/test' => 'main/list', - ); - - - - protected $menuTitle = 'users'; - - - public function runObservers($run_header = true) - { - // Catch useraction - if (isset($_POST['updatesettings'])) - { - - } - - return parent::runObservers($run_header); - } - - - -} - -class usersettings_admin_ui extends e_admin_ui -{ - public function EditPage() - { - - } - -} -*/ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); @@ -209,87 +145,11 @@ if(!is_array($info) || ($info['user_admin'] == 1 && (!defined('ADMINPERMS') || A } } -// TODO - Remove all the adminEdit stuff. -/* - -if($adminEdit) // try to stay in Admin when admin is editing. -{ - $mes = e107::getMessage(); - $ADMIN_USERSETTINGS_EDIT = $mes->render(). " - - - - - - - {USERNAME} - {LOGINNAME} - - - - - - - - - - - - {CUSTOMTITLE} - - {PASSWORD1} - {PASSWORD_LEN} - {PASSWORD2} - - - - - - - - +require_once (HEADERF); -{AVATAR_UPLOAD} -{PHOTO_UPLOAD} - -{USERCLASSES} -{USEREXTENDED_ALL} - - -{SIGNATURE=cols=58&rows=4} -{SIGNATURE_HELP} - -
".LAN_USER_60.req(!$pref['disable_emailcheck'])." - {EMAIL} -
".LAN_USER_63.req($pref['signup_option_realname'])." - {REALNAME} -
".LAN_USER_83." - {HIDEEMAIL=radio} - -
".LAN_USER_07.req($pref['signup_option_image'])." - {AVATAR_REMOTE} -
-
- ".e107::getForm()->admin_button('updatesettings',LAN_UPDATE,'update')." -
- -"; - - -$USERSETTINGS_EDIT = $ADMIN_USERSETTINGS_EDIT; -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php"); -new usersetting_admin(); -require_once (e_ADMIN."auth.php"); -//e107::getAdminUI()->runPage(); -} -*/ -// else -{ - require_once (HEADERF); -} // Save user settings (changes only)