From 79224fe54dc230beb189e5f0bb32847c0b0afeff Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Wed, 18 Jul 2012 03:47:28 +0000 Subject: [PATCH] Admin-ui type 'password' added. Password modification now possible via admin->users. Installed Media path issue corrected. --- e107_admin/users.php | 2 +- e107_handlers/admin_ui.php | 12 +++++++++++- e107_handlers/e107_class.php | 12 ++++++++++++ e107_handlers/form_handler.php | 1 + 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/e107_admin/users.php b/e107_admin/users.php index c2d950d51..721bf0087 100644 --- a/e107_admin/users.php +++ b/e107_admin/users.php @@ -683,7 +683,7 @@ class users_admin_ui extends e_admin_ui 'user_loginname' => array('title' => LAN_USER_02, 'type' => 'text', 'width' => 'auto'), // User name 'user_login' => array('title' => LAN_USER_03, 'type' => 'text', 'width' => 'auto'), // Real name (no real vetting) 'user_customtitle' => array('title' => LAN_USER_04, 'type' => 'text', 'width' => 'auto'), // No real vetting - // 'user_password' => array('title' => LAN_USER_05, 'type' => 'text', 'width' => 'auto'), //TODO add md5 option to form handler? + 'user_password' => array('title' => LAN_USER_05, 'type' => 'password', 'width' => 'auto'), //TODO add md5 option to form handler? 'user_sess' => array('title' => 'Session', 'type' => 'text', 'width' => 'auto'), // Photo 'user_image' => array('title' => LAN_USER_07, 'type' => 'text', 'width' => 'auto'), // Avatar 'user_email' => array('title' => LAN_USER_08, 'type' => 'text', 'width' => 'auto'), diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 6927f7ed4..3434d187a 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -824,7 +824,7 @@ class e_admin_response global $HEADER, $FOOTER, $CUSTOMHEADER, $CUSTOMFOOTER; $HEADER = $FOOTER = ''; $CUSTOMHEADER = $CUSTOMFOOTER = array(); - + //TODO generic $_GET to activate for any page of admin. // New if(!defined('e_IFRAME')) { @@ -2842,6 +2842,16 @@ class e_admin_controller_ui extends e_admin_controller } switch($attributes['type']) { + + case 'password': //TODO more encryption options. + if(strlen($value) < 30) // expect a non-md5 value if less than 32 chars. + { + $value = md5($value); + } + + break; + + case 'datestamp': if(!is_numeric($value)) { diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index b916e1bf9..adecb321f 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -373,8 +373,20 @@ class e107 public function setDirs($e107_dirs, $e107_config_override = array()) { $override = array_merge((array) $e107_dirs, (array) $e107_config_override); + // override all $this->e107_dirs = array_merge($this->defaultDirs($override), $override); + + if(strpos($this->e107_dirs['MEDIA_DIRECTORY'],$this->site_path) === false) + { + $this->e107_dirs['MEDIA_DIRECTORY'] .= $this->site_path."/"; // multisite support. + } + + if(strpos($this->e107_dirs['SYSTEM_DIRECTORY'],$this->site_path) === false) + { + $this->e107_dirs['SYSTEM_DIRECTORY'] .= $this->site_path."/"; // multisite support. + } + return $this; } diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 603d3d3a3..78b88483f 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -2035,6 +2035,7 @@ class e_form case 'url': case 'email': case 'text': + case 'password': // encrypts to md5 when saved. $maxlength = vartrue($parms['maxlength'], 255); unset($parms['maxlength']); $ret = vartrue($parms['pre']).$this->text($key, $value, $maxlength, vartrue($parms['__options'])).vartrue($parms['post']);