From 14a840636a9ab2ddeb91dc956b848b609d8fa169 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Wed, 8 Jul 2009 06:58:00 +0000 Subject: [PATCH] Notice/Warning Removal. + admin -> users cleanup. (work in progress) --- e107_admin/includes/infopanel.php | 13 +- e107_admin/menus.php | 7 +- e107_admin/notify.php | 30 +-- e107_admin/users.php | 319 +++++++++++++++++++----------- e107_handlers/form_handler.php | 6 +- e107_handlers/theme_handler.php | 17 +- e107_handlers/userclass_class.php | 17 +- 7 files changed, 264 insertions(+), 145 deletions(-) diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php index 26399909f..0f9cd1c76 100644 --- a/e107_admin/includes/infopanel.php +++ b/e107_admin/includes/infopanel.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/includes/infopanel.php,v $ -| $Revision: 1.3 $ -| $Date: 2009-07-08 01:29:53 $ +| $Revision: 1.4 $ +| $Date: 2009-07-08 06:58:00 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -115,7 +115,14 @@ $text .= "
e107 News
-
+
"; + /* + require_once(e_HANDLER.'xml_class.php'); + $xml = new xmlClass; + $vars = $xml->loadXMLfile('http://www.e107.org/e107_plugins/rss_menu/rss.php?1.2', true, true); + $text .= print_r($vars,TRUE);*/ + + $text .= " RSS News feed from e107.org goes here.
diff --git a/e107_admin/menus.php b/e107_admin/menus.php index d1184b9ce..89e88888b 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $ -| $Revision: 1.20 $ -| $Date: 2009-07-08 01:28:55 $ +| $Revision: 1.21 $ +| $Date: 2009-07-08 06:58:00 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -200,11 +200,12 @@ function getMenuPreset($layout) $iD = $val['@attributes']['id']; foreach($val['menu'] as $k=>$v) { + $uclass = (defined(trim($v['@attributes']['userclass']))) ? constant(trim($v['@attributes']['userclass'])) : 0; $menuArea[] = array( 'menu_location' => $iD, 'menu_order' => $k, 'menu_name' => $v['@attributes']['name']."_menu", - 'menu_class' => intval(constant(trim($v['@attributes']['userclass']))) + 'menu_class' => intval($uclass) ); } } diff --git a/e107_admin/notify.php b/e107_admin/notify.php index 178e8848d..bf8f9a51e 100644 --- a/e107_admin/notify.php +++ b/e107_admin/notify.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/notify.php,v $ -| $Revision: 1.5 $ -| $Date: 2009-04-28 00:06:17 $ +| $Revision: 1.6 $ +| $Date: 2009-07-08 06:58:00 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -44,7 +44,7 @@ if (isset($_POST['update'])) $nc -> config(); -class notify_config +class notify_config { var $notify_prefs; var $changeList = array(); @@ -88,13 +88,14 @@ class notify_config $text = "
- +
+ - + "; - $text .= " - + $text .= " + "; $text .= $this -> render_event('usersup', NU_LAN_2); @@ -103,14 +104,14 @@ class notify_config $text .= $this -> render_event('logout', NU_LAN_5); $text .= " - + "; $text .= $this -> render_event('flood', NS_LAN_2); $text .= " - + "; $text .= $this -> render_event('subnews', NN_LAN_2); @@ -119,7 +120,7 @@ class notify_config $text .= $this -> render_event('newsdel', NN_LAN_5); $text .= " - + "; $text .= $this -> render_event('fileupload', NF_LAN_2); @@ -130,7 +131,7 @@ class notify_config { require(e_PLUGIN.$plugin_id.'/e_notify.php'); $text .= " - + "; foreach ($config_events as $event_id => $event_text) { @@ -140,8 +141,9 @@ class notify_config } $text .= " - + +
".NT_LAN_2.":".NT_LAN_2.":
".NU_LAN_1."
".NU_LAN_1."
".NS_LAN_1."".NS_LAN_1."
".NN_LAN_1."".NN_LAN_1."
".NF_LAN_1."".NF_LAN_1."
".$config_category."".$config_category."
".$rs -> form_button('submit', 'update', LAN_UPDATE)."".$rs -> form_button('submit', 'update', LAN_UPDATE)."
"; @@ -155,8 +157,8 @@ class notify_config global $rs, $tp, $uc; $text .= " - ".$description.": - + ".$description.": + ".$uc->uc_dropdown('event['.$id.'][class]', $this -> notify_prefs['event'][$id]['class'],"nobody,main,admin,member,classes,email","onchange=\"mail_field(this.value,'event_".$id."');\" "); if($this -> notify_prefs['event'][$id]['class'] == 'email') diff --git a/e107_admin/users.php b/e107_admin/users.php index 2aaf41cd9..187d27481 100644 --- a/e107_admin/users.php +++ b/e107_admin/users.php @@ -9,12 +9,13 @@ * Administration Area - Users * * $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $ -* $Revision: 1.36 $ -* $Date: 2009-07-06 07:50:44 $ -* $Author: marj_nl_fr $ +* $Revision: 1.37 $ +* $Date: 2009-07-08 06:58:00 $ +* $Author: e107coders $ * */ require_once('../class2.php'); +include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); if (!getperms('4')) { @@ -23,6 +24,18 @@ if (!getperms('4')) } +foreach($_POST['useraction'] as $key=>$val) +{ + if($val) + { + $_POST['useraction'] = $val; + $_POST['userip'] = $_POST['userip'][$key]; + $_POST['userid'] = $key; + break; + } +} + + if (isset($_POST['useraction']) && $_POST['useraction'] == 'userinfo') { header('location:'.e_ADMIN."userinfo.php?".$e107->tp->toDB($_POST['userip'])); @@ -66,20 +79,26 @@ if(isset($_POST['updateRanks'])) } $e_sub_cat = 'users'; -$user = new users; -require_once('auth.php'); +require_once('auth.php'); +$user = new users; require_once(e_HANDLER.'form_handler.php'); require_once(e_HANDLER.'userclass_class.php'); -require_once(e_HANDLER.'user_handler.php'); + include_once(e_HANDLER.'user_extended_class.php'); require_once(e_HANDLER.'validator_class.php'); -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); + + + + require_once(e_HANDLER.'user_handler.php'); + // $userMethods = new UserHandler; +// $colList = $userMethods->getNiceNames(TRUE); + $ue = new e107_user_extended; $userMethods = new UserHandler; $user_data = array(); -$rs = new form; +$frm = new e_form; if (e_QUERY) { @@ -632,25 +651,85 @@ require_once("footer.php"); class users { - function show_existing_users($action, $sub_action, $id, $from, $amount) + var $fields = array(); + var $fieldpref = array(); + + + function users() { - global $sql, $rs, $ns, $tp, $mySQLdefaultdb,$pref,$unverified, $userMethods; - $e107 = e107::getInstance(); - // save the display choices. - if(isset($_POST['searchdisp'])) + + global $pref, $user_pref, $sql, $tp; + + + if(isset($pref['admin_user_disp'])) { - $pref['admin_user_disp'] = implode("|",$_POST['searchdisp']); - save_prefs(); + $user_pref['admin_users_columns'] = ($pref['admin_user_disp']) ? explode("|",$pref['admin_user_disp']) : array('user_name', 'user_class'); + save_prefs('user'); + unset($pref['admin_user_disp']); + save_prefs; + } + $this->usersSaveColumnPref(); + + $this->fieldpref = (!$user_pref['admin_users_columns']) ? array('user_name', 'user_class') : $user_pref['admin_users_columns']; + + $this->fields = array( + 'user_id' => array('title'=> 'Id', 'width'=>'5%', 'forced'=> TRUE), + 'user_status' => array('title'=> ADLAN_134, 'forced'=> TRUE), + 'user_name' => array('title'=> LAN_USER_01, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first'), // Display name + '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'), + 'user_sess' => array('title'=> LAN_USER_06, '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'), + 'user_signature' => array('title'=> LAN_USER_09, 'type' => 'text', 'width' => 'auto'), + 'user_hideemail' => array('title'=> LAN_USER_10, 'type' => 'int', 'width' => 'auto'), + 'user_xup' => array('title'=> LAN_USER_11, 'type' => 'text', 'width' => 'auto'), + 'user_class' => array('title'=> LAN_USER_12, 'type' => 'class'), + 'user_join' => array('title' => LAN_USER_14, 'width'=> 'auto'), + 'user_lastvisit' => array('title' => LAN_USER_15, 'width'=> 'auto'), + 'user_currentvisit' => array('title' => LAN_USER_16, 'width'=> 'auto'), + 'user_comments' => array('title' => LAN_USER_17, 'width'=> 'auto'), + 'user_ip' => array('title' => LAN_USER_18, 'width'=> 'auto'), + 'user_ban' => array('title' => LAN_USER_19, 'width'=> 'auto'), + 'user_prefs' => array('title' => LAN_USER_20, 'width'=> 'auto'), + 'user_visits' => array('title' => LAN_USER_21, 'width'=> 'auto'), + 'user_admin' => array('title' => LAN_USER_22, 'width'=> 'auto'), + 'user_perms' => array('title' => LAN_USER_23, 'width'=> 'auto'), + 'user_pwchange' => array('title' => LAN_USER_24, 'width'=> 'auto') + + ); + + + $sql -> db_Select("user_extended_struct"); + while($row = $sql-> db_Fetch()) + { + $field = "user_".$row['user_extended_struct_name']; + $title = ucfirst(str_replace("user_","",$field)); + + $this->fields[$field] = array('title'=>$title,'width'=>'auto'); } - if(!$pref['admin_user_disp']) + $this->fields['options'] = array('title' => LAN_OPTIONS, 'width'=>'10%', "thclass" => "center last"); + + } + + function usersSaveColumnPref() + { + global $pref,$user_pref, $admin_log; + if(isset($_POST['submit-e-columns'])) { - $search_display = array('user_name', 'user_class'); - } - else - { - $search_display = explode('|', $pref['admin_user_disp']); + $user_pref['admin_users_columns'] = $_POST['e-columns']; + save_prefs('user'); } + } + + + function show_existing_users($action, $sub_action, $id, $from, $amount) + { + global $sql, $frm, $ns, $tp, $mySQLdefaultdb,$pref,$unverified, $userMethods; + $e107 = e107::getInstance(); $text = "
"; @@ -660,7 +739,7 @@ class users $query = 'WHERE '. $query .= (strpos($_POST['searchquery'], "@") !== FALSE) ? "user_email REGEXP('".$_POST['searchquery']."') OR ": ""; $query .= (strpos($_POST['searchquery'], ".") !== FALSE) ? "user_ip REGEXP('".$_POST['searchquery']."') OR ": ""; - foreach($search_display as $disp) + foreach($this->fieldpref as $disp) { $query .= $disp." REGEXP('".$_POST['searchquery']."') OR "; } @@ -685,39 +764,54 @@ class users // $user_total = db_Count($table, $fields = '(*)', $qry_insert = 'SELECT u.*, ue.* FROM `#user` AS u LEFT JOIN `#user_extended` AS ue ON ue.user_extended_id = u.user_id '; + $field_count = count($this->fieldpref); + if ($user_total = $sql->db_Select_gen($qry_insert. $query)) { - $text .= " + $text .= " +
+ ".NWSLAN_4." +
+ ".$frm->colGroup($this->fields,$this->fieldpref)." + + ".$frm->thead($this->fields,$this->fieldpref)." + + "; + + + + /* - - "; + + "; // Search Display Column header. $display_lan = $userMethods->getNiceNames(TRUE); // List of field names and descriptive names - foreach($search_display as $disp) + foreach($this->fieldpref as $disp) { if (isset($display_lan[$disp])) { - $text .= ""; + $text .= ""; } else { - $text .= ""; + $text .= ""; } } // ------------------------------ - $text .= " - "; + $text .= " + + ";*/ while ($row = $sql->db_Fetch()) { extract($row); $text .= " - - + "; + $text .= ""; } - $text .= "
ID".USRLAN_79."ID".USRLAN_79."".$display_lan[$disp]."".$display_lan[$disp]."".ucwords(str_replace("_"," ",$disp))."".ucwords(str_replace("_"," ",$disp))."".LAN_OPTIONS."
".LAN_OPTIONS."
{$user_id}"; + {$user_id}"; if ($user_perms == "0") { $text .= "
".LAN_MAINADMIN."
"; @@ -746,9 +840,9 @@ class users $datefields = array("user_lastpost","user_lastvisit","user_join","user_currentvisit"); $boleanfields = array("user_admin","user_hideemail","user_ban"); - foreach($search_display as $disp) + foreach($this->fieldpref as $disp) { - $text .= "
"; + $text .= ""; if($disp == 'user_class') { if ($user_class) @@ -795,13 +889,13 @@ class users // ------------------------------------------------------------- $qry = (e_QUERY) ? "?".e_QUERY : ""; $text .= " - - + +
- - - + +
"; - $text .= "
"; + $text .= " "; + + + } if($action == "unverified") @@ -881,24 +978,22 @@ class users $text .= "
".$tp->parseTemplate("{NEXTPREV={$parms}}"); } - // Search - display options etc. . + // Search etc. . - $text .= "
\n"; + $text .= "
+ + + +
+
\n"; $text .= "

\n\n \n

\n"; - + /* $text .= "
".LAN_DISPLAYOPT."
"; $text .= " \n
"; @@ -984,72 +1082,72 @@ class users $pref['memberlist_access'] = varset($pref['memberlist_access'], e_UC_MEMBER); $text = "
- +
- - + - - + - - + - - + - - + - - + - - + - - + - - + - - + @@ -1057,13 +1155,13 @@ class users - - + - @@ -1121,49 +1219,49 @@ class users // Add a new user - may be passed existing data if there was an entry error on first pass function add_user($user_data) { - global $rs, $ns, $pref, $e_userclass; + global $frm, $ns, $pref, $e_userclass; if (!is_object($e_userclass)) $e_userclass = new user_class; - $text = "
". $rs->form_open("post", e_SELF.(e_QUERY ? '?'.e_QUERY : ''), "adduserform")." -
".USRLAN_44.":". ($pref['avatar_upload'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO). (!FILE_UPLOADS ? " (".USRLAN_58.")" : "")." + ".USRLAN_44.":". ($pref['avatar_upload'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO). (!FILE_UPLOADS ? " (".USRLAN_58.")" : "")."
".USRLAN_53.":". ($pref['photo_upload'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO). (!FILE_UPLOADS ? " (".USRLAN_58.")" : "")." + ".USRLAN_53.":". ($pref['photo_upload'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO). (!FILE_UPLOADS ? " (".USRLAN_58.")" : "")."
".USRLAN_47.": + ".USRLAN_47.": (".USRLAN_48.")
".USRLAN_49.": + ".USRLAN_49.": (".USRLAN_50.")
".USRLAN_126.":". ($pref['profile_rate'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO)." + ".USRLAN_126.":". ($pref['profile_rate'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO)."
".USRLAN_127.":". ($pref['profile_comments'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO)." + ".USRLAN_127.":". ($pref['profile_comments'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO)."
".USRLAN_133.":
".USRLAN_134."
". ($pref['force_userupdate'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO)." + ".USRLAN_133.":
".USRLAN_134."
". ($pref['force_userupdate'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO)."
".USRLAN_93."
".USRLAN_94."
+ ".USRLAN_93."
".USRLAN_94."
".USRLAN_95."
".USRLAN_130."
".USRLAN_131."
  + ".USRLAN_130."
".USRLAN_131."
  ".USRLAN_132."  
".USRLAN_146.":".USRLAN_146.":
".USRLAN_190."
".USRLAN_191."
+ ".USRLAN_190."
".USRLAN_191."
".USRLAN_192."
+
+ $text = "
". $frm->form_open("post", e_SELF.(e_QUERY ? '?'.e_QUERY : ''), "adduserform")." +
- - + - - + - - + - - + - - + - - + \n"; @@ -1175,21 +1273,22 @@ class users if ($temp) { $text .= " - + \n"; } $text .= " - + + - +
".USRLAN_61." - ".$rs->form_text('username', 40, varset($user_data['user_name'],""), varset($pref['displayname_maxlength'],15))." + ".USRLAN_61." + ".$frm->form_text('username', 40, varset($user_data['user_name'],""), varset($pref['displayname_maxlength'],15))."
".USRLAN_128." - ".$rs->form_text('loginname', 40, varset($user_data['user_loginname'],""), varset($pref['loginname_maxlength'],30))."   - ".$rs->form_checkbox('generateloginname',1,varset($pref['predefinedLoginName'],FALSE)).USRLAN_170." + ".USRLAN_128." + ".$frm->form_text('loginname', 40, varset($user_data['user_loginname'],""), varset($pref['loginname_maxlength'],30))."   + ".$frm->form_checkbox('generateloginname',1,varset($pref['predefinedLoginName'],FALSE)).USRLAN_170."
".USRLAN_129." - ".$rs->form_text("realname", 40, varset($user_data['user_login'],""), 30)." + ".USRLAN_129." + ".$frm->form_text("realname", 40, varset($user_data['user_login'],""), 30)."
".USRLAN_62." - ".$rs->form_password("password1", 40, "", 20)."   - ".$rs->form_checkbox('generatepassword',1,FALSE).USRLAN_171." + ".USRLAN_62." + ".$frm->form_password("password1", 40, "", 20)."   + ".$frm->form_checkbox('generatepassword',1,FALSE).USRLAN_171."
".USRLAN_63." - ".$rs->form_password("password2", 40, "", 20)." + ".USRLAN_63." + ".$frm->form_password("password2", 40, "", 20)."
".USRLAN_64." - ".$rs->form_text("email", 60, varset($user_data['user_email'],""), 100)." + ".USRLAN_64." + ".$frm->form_text("email", 60, varset($user_data['user_email'],""), 100)."
+ ".USRLAN_120." - {$temp}{$temp}
- ".USRLAN_181." -
+ ".USRLAN_181." +
- - - + + +
diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 8c6f1b13b..10cb81fa3 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -9,8 +9,8 @@ * Form Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $ - * $Revision: 1.29 $ - * $Date: 2009-07-07 06:26:50 $ + * $Revision: 1.30 $ + * $Date: 2009-07-08 06:58:00 $ * $Author: e107coders $ * */ @@ -649,6 +649,8 @@ class e_form function filterValue($type,$fields) { + + if($type) { diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 682574486..3c8e1815b 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $ -| $Revision: 1.26 $ -| $Date: 2009-07-07 22:56:12 $ +| $Revision: 1.27 $ +| $Date: 2009-07-08 06:58:00 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -733,11 +733,14 @@ class themeHandler{ $l = $this->themeArray[$theme]; - foreach($l['layouts'] as $key=>$val) + if($l['layouts']) { - if(isset($val['@attributes']['default']) && ($val['@attributes']['default'] == "true")) + foreach($l['layouts'] as $key=>$val) { - return $key; + if(isset($val['@attributes']['default']) && ($val['@attributes']['default'] == "true")) + { + return $key; + } } } } @@ -831,11 +834,13 @@ class themeHandler{ } // echo "
".$path."
"; + + foreach($themeContentsArray as $line) { if(strstr($line,"CUSTOMPAGES")) { - eval(str_replace("$","\\$",$line)); + eval(str_replace("$","\$",$line)); } } if(is_array($CUSTOMPAGES)) diff --git a/e107_handlers/userclass_class.php b/e107_handlers/userclass_class.php index 0795bed1c..68b30a06c 100644 --- a/e107_handlers/userclass_class.php +++ b/e107_handlers/userclass_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $ -| $Revision: 1.34 $ -| $Date: 2009-07-07 07:25:27 $ +| $Revision: 1.35 $ +| $Date: 2009-07-08 06:58:00 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -494,14 +494,17 @@ class user_class { $ret = ''; $nest_level++; - foreach ($this->class_tree[$listnum]['class_children'] as $p) + if(isset($this->class_tree[$listnum]['class_children'])) { - // Looks like we don't need to differentiate between function and class calls - if (isset($perms[$p])) + foreach ($this->class_tree[$listnum]['class_children'] as $p) { - $ret .= call_user_func($callback,$treename, $p,$current_value,$nest_level, $opt_options); + // Looks like we don't need to differentiate between function and class calls + if (isset($perms[$p])) + { + $ret .= call_user_func($callback,$treename, $p,$current_value,$nest_level, $opt_options); + } + $ret .= $this->vetted_sub_tree($treename, $callback,$p,$nest_level,$current_value, $perms, $opt_options); } - $ret .= $this->vetted_sub_tree($treename, $callback,$p,$nest_level,$current_value, $perms, $opt_options); } return $ret; }