From 855c6f2b8d4d02d2b042f92cf31e362ea6ee2d4a Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Mon, 4 Jun 2012 09:08:54 +0000 Subject: [PATCH] Rework of admin->users to use admin-ui. Requires more work to integrate 1.0.x functionality. --- e107_admin/users.php | 684 +++++++++++++++++++++++++++++++-- e107_handlers/form_handler.php | 13 +- e107_handlers/user_handler.php | 58 +-- 3 files changed, 680 insertions(+), 75 deletions(-) diff --git a/e107_admin/users.php b/e107_admin/users.php index 756272424..d9eee766b 100644 --- a/e107_admin/users.php +++ b/e107_admin/users.php @@ -86,7 +86,7 @@ require_once (e_HANDLER.'userclass_class.php'); include_once (e_HANDLER.'user_extended_class.php'); require_once (e_HANDLER.'validator_class.php'); $user = new users; -require_once ('auth.php'); +//require_once ('auth.php'); @@ -207,11 +207,13 @@ if (isset ($_POST['update_options'])) { save_prefs(); // Only save if changes - $user->show_message(USRLAN_1); + $mes->addSuccess(USRLAN_1); + //$user->show_message(USRLAN_1); } else { - $user->show_message(USRLAN_193); + $mes->addError(USRLAN_193); + // $user->show_message(USRLAN_193); } } // ------- Prune Users. -------------- @@ -245,8 +247,16 @@ if (isset ($_POST['prune'])) // ------- Quick Add User -------------- -if (isset ($_POST['adduser'])) +function addUser() { + + $e107cache = e107::getCache(); + $userMethods = e107::getUserSession(); + $mes = e107::getMessage(); + $sql = e107::getDb(); + $e_event = e107::getEvent(); + global $admin_log; + if (!$_POST['ac'] == md5(ADMINPWCHANGE)) { exit; @@ -296,9 +306,10 @@ if (isset ($_POST['adduser'])) } if (count($allData['errors'])) { - require_once (e_HANDLER."message_handler.php"); + // require_once (e_HANDLER."message_handler.php"); $temp = validatorClass :: makeErrorList($allData,'USER_ERR_','%n - %x - %t: %v','
',$userMethods->userVettingInfo); - message_handler('P_ALERT',$temp); + // message_handler('P_ALERT',$temp); + $mes->addError($temp); $error = true; } // Always save some of the entered data - then we can redisplay on error @@ -393,12 +404,17 @@ if (isset ($_POST['adduser'])) unset ($user_data); // Don't recycle the data once the user's been accepted without error } + $mes->addSuccess($message); + } + else + { + } - if (isset ($message)) - { - $user->show_message($message); - } + + // $mes = e107::getMessage(); + + } // ------- Bounce --> Unverified -------------- @@ -415,6 +431,7 @@ if (isset ($_POST['useraction']) && $_POST['useraction'] == "reqverify") $sub_action = "user_id"; } } +/* if (isset ($_POST['useraction']) && $_POST['useraction'] == "ban") { $user->user_ban($_POST['userid']); @@ -451,7 +468,7 @@ if (isset ($_POST['useraction']) && $_POST['useraction'] == 'userclass') // exit; $user->show_userclass($_POST['userid']); } - +*/ // ---- Login as another user -------------------- if (isset ($_POST['useraction']) && $_POST['useraction'] == 'loginas') { @@ -513,6 +530,7 @@ if (isset ($_POST['useraction']) && $_POST['useraction'] == 'test') $prm = e107::getUserPerms(); // ------- Make Admin -------------- +/* if ((varset($_POST['useraction'])== "admin" || varset($_POST['useraction'])== "adminperms") && getperms('3')) { $sql->db_Select("user","user_id, user_name, user_perms","user_id='".$_POST['userid']."'"); @@ -540,7 +558,7 @@ if ((varset($_POST['useraction'])== "admin" || varset($_POST['useraction'])== "a require_once ("footer.php"); exit; } - +*/ if (varset($_POST['update_admin'])) // Update admin Perms. { $prm->updatePerms($_POST['a_id'],$_POST['perms']); @@ -598,6 +616,582 @@ echo "from= ".$from."
"; echo "amount= ".$amount."
"; */ // $unverified = $sql->db_Count("user","(*)","WHERE user_ban = 2"); + + + +// ----------------------------- START NEW -------------------------- + +class users_admin extends e_admin_dispatcher +{ + + protected $modes = array( + 'main' => array( + 'controller' => 'users_admin_ui', + 'path' => null, + 'ui' => 'users_admin_form_ui', + 'uipath' => null + ) + ); + + + protected $adminMenu = array( + 'main/list' => array('caption'=> 'Manage', 'perm' => '0'), + 'main/add' => array('caption'=> LAN_USER_QUICKADD, 'perm' => '4|U0|U1'), + 'main/prefs' => array('caption'=> LAN_OPTIONS, 'perm' => '4|U2'), + 'main/ranks' => array('caption'=> LAN_USER_RANKS, 'perm' => '4|U3') + ); + + /* + + $var ['prune']['text'] = LAN_USER_PRUNE; + $var ['prune']['link'] = e_ADMIN.'users.php?action=prune';// Will be moved to "Schedule tasks" + $var ['prune']['perm'] = '4'; + +*/ + protected $adminMenuAliases = array( + 'main/edit' => 'main/list' + ); + + protected $menuTitle = 'users'; +} + + +class users_admin_ui extends e_admin_ui +{ + + protected $pluginTitle = LAN_USER; + protected $pluginName = 'core'; + protected $table = "user"; + + // protected $listQry = "SELECT SQL_CALC_FOUND_ROWS * FROM #users"; // without any Order or Limit. + protected $listQry = "SELECT u.*,ue.* from #user AS u left join #user_extended AS ue ON u.user_id = ue.user_extended_id "; // without any Order or Limit. + + //protected $editQry = "SELECT * FROM #users WHERE comment_id = {ID}"; + + protected $pid = "user_id"; + protected $perPage = 10; + protected $batchDelete = true; + protected $listOrder = 'user_id DESC'; + + + //TODO - finish 'user' type, set 'data' to all editable fields, set 'noedit' for all non-editable fields + protected $fields = array( + 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), + + 'user_id' => array('title' => 'Id', 'type' =>'integer', 'width' => '5%','forced' => true), + // 'user_status' => array('title' => LAN_STATUS, 'type' => 'method', 'alias'=>'user_status', 'width' => 'auto','forced' => true, 'nosort'=>TRUE), + 'user_ban' => array('title' => LAN_STATUS, 'type' => 'method', 'width' => 'auto', 'filter'=>true, 'batch'=>true,'thclass'=>'center', 'class'=>'center'), + + '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' => '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'), + 'user_hideemail' => array('title' => LAN_USER_10, 'type' => 'boolean', 'width' => 'auto', 'thclass'=>'center', 'class'=>'center', 'filter'=>true, 'batch'=>true, 'readParms'=>'trueonly=1'), + 'user_xup' => array('title' => 'Xup', 'type' => 'text', 'width' => 'auto'), + 'user_class' => array('title' => LAN_USER_12, 'type' => 'userclass' , 'filter'=>true, 'batch'=>true), + 'user_join' => array('title' => LAN_USER_14, 'type' => 'datestamp', 'width' => 'auto'), + 'user_lastvisit' => array('title' => LAN_USER_15, 'type' => 'datestamp', 'width' => 'auto'), + 'user_currentvisit' => array('title' => LAN_USER_16, 'type' => 'datestamp', 'width' => 'auto'), + 'user_comments' => array('title' => LAN_USER_17, 'type' => 'integer', 'width' => 'auto','thclass'=>'right','class'=>'right'), + 'user_lastpost' => array('title' => 'Last Post', 'type' => 'datestamp', 'width' => 'auto'), + 'user_ip' => array('title' => LAN_USER_18, 'type' => 'ip', 'width' => 'auto'), + // 'user_prefs' => array('title' => LAN_USER_20, 'type' => 'text', 'width' => 'auto'), + 'user_visits' => array('title' => LAN_USER_21, 'type' => 'integer', 'width' => 'auto','thclass'=>'right','class'=>'right'), + 'user_admin' => array('title' => LAN_USER_22, 'type' => 'boolean', 'width' => 'auto', 'thclass'=>'center', 'class'=>'center', 'filter'=>true, 'batch'=>true, 'readParms'=>'trueonly=1'), + 'user_perms' => array('title' => LAN_USER_23, 'type' => 'method', 'width' => 'auto'), + 'user_pwchange' => array('title' => LAN_USER_24, 'type'=>'datestamp' , 'width' => 'auto'), + + ); + + protected $fieldpref = array('user_ban','user_name','user_loginname','user_login','user_email','user_class','user_ban','user_admin'); + + protected $prefs = array( + // 'anon_post' => array('title'=>PRFLAN_32, 'type'=>'boolean'), + ); + + + + function init() + { + + $sql = e107::getDb(); + $tp = e107::getParser(); + if($sql->db_Select('user_extended_struct', 'user_extended_struct_name,user_extended_struct_text', "user_extended_struct_type > 0 AND user_extended_struct_text != '_system_' ORDER BY user_extended_struct_parent ASC")) + { + while ($row = $sql->db_Fetch()) + { + $field = "user_".$row['user_extended_struct_name']; + $title = ucfirst(str_replace("user_","",$field)); + $label = $tp->toHtml($row['user_extended_struct_text'],false,'defs'); + $this->fields[$field] = array('title' => $label,'width' => 'auto','type'=>'text'); + } + } + + + $this->fields['user_signature'] = array('title' => LAN_USER_09, 'type' => 'bbarea', 'width' => 'auto'); + + + $this->fields['options'] = array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center'); + + + if(!getperms('4|U0')) // Quick Add User Access Only. + { + unset($this->fields['checkboxes']); + unset($this->fields['options']); + } + + if ((varset($_POST['useraction'])== "admin" || varset($_POST['useraction'])== "adminperms") && getperms('3')) + { + $this->adminPerms(); + } + + if(isset ($_POST['adduser'])) + { + addUser(); + } + + } + + function ranksPage() + { + //echo "hello"; + showRanks(); + + } + + function adminPerms() // ------- Make Admin -------------- // - maybe no longer needed - on 'edit' page now. + { + + $sql = e107::getDb(); + + global $admin_log,$user; + + $sql->db_Select("user","user_id, user_name, user_perms","user_id='".$_POST['userid']."'"); + $row = $sql->db_Fetch(); + + if(varset($_POST['useraction'])== "admin") + { + $sql->db_Update("user","user_admin='1' WHERE user_id='".$_POST['userid']."' "); + } + + $admin_log->log_event('USET_08',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_164),E_LOG_INFORMATIVE); + // $user->show_message($row['user_name']." ".USRLAN_3." ".USRLAN_4.""); + $action = "main"; + if (!$sub_action) + { + $sub_action = "user_id"; + } + if (!$id) + { + $id = "DESC"; + } + + $prm = e107::getUserPerms(); + $prm->edit_administrator($row); + + } + + + + function addPage() + { + + global $rs,$pref,$e_userclass; + + $prm = e107::getUserPerms(); + $list = $prm->getPermList(); + $frm = e107::getForm(); + $ns = e107::getRender(); + $mes = e107::getMessage(); + + if (!is_object($e_userclass)) $e_userclass = new user_class; + + + $text = "
".$rs->form_open("post",e_SELF.(e_QUERY ? '?'.e_QUERY : ''),"adduserform")." + + + + + + + + + + + + + + + + + + + + + + + + "; + + + + $text .= " + + + + + + + + + "; + + //FIXME check what this is doing exactly.. is it a confirmation email (activation link) or just a notification? + // Give drop-down option to: 1) Notify User and Activate. 2) Notify User and require activation. 3) Don't Notify + + if (!isset ($user_data['user_class'])) + $user_data['user_class'] = varset($pref['initial_user_classes'],''); + $temp = $e_userclass->vetted_tree('class',array($e_userclass,'checkbox_desc'),$user_data['user_class'],'classes'); + + if ($temp) + { + $text .= " + + \n"; + } + + // Make Admin. + $text .= " + + + \n"; + + + $text .= " + +
".USRLAN_61." + ".$rs->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))."   + ".$frm->checkbox_label(USRLAN_170,'generateloginname', 1,varset($pref['predefinedLoginName'],false))." +
".USRLAN_129." + ".$rs->form_text("realname",40,varset($user_data['user_login'],""),30)." +
".USRLAN_62."".$frm->password('password','',20,array('size'=>40,'class'=>'tbox e-password-admin'))."
".USRLAN_64." + ".$rs->form_text("email",60,varset($user_data['user_email'],""),100)." +
Require Confirmation".$frm->checkbox_label(USRLAN_181,'sendconfemail', 1)."
+ ".USRLAN_120." + + ".USRLAN_120." +
+ {$temp} +
".USRLAN_35." + Set Permissions +
\n"; + + $text .= $prm->renderPermTable('grouped'); + + $text .= "
+
". + $frm->admin_button('adduser', USRLAN_60, 'submit')." + +
+ +
+ "; + + + echo $mes->render().$text; + //$ns->tablerender(USRLAN_59,$mes->render().$text); + } + + + + + function prefsPage() + { + global $ns,$pref,$e_userclass; + $mes = e107::getMessage(); + $frm = e107::getForm(); + + if (!is_object($e_userclass)) + $e_userclass = new user_class; + + $pref['memberlist_access'] = varset($pref['memberlist_access'],e_UC_MEMBER); + + $text = "
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
".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_47.": + (".USRLAN_48.") +
".USRLAN_49.": + (".USRLAN_50.") +
".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_133.":
".USRLAN_134."
".($pref['force_userupdate'] ? "".LAN_YES."  ".LAN_NO : "".LAN_YES."  ".LAN_NO)." +
".USRLAN_93."
".USRLAN_94."
+ ".USRLAN_95." +
".USRLAN_130."
".USRLAN_131."
  + ".USRLAN_132."   +
".USRLAN_146.": +
".USRLAN_190."
".USRLAN_191."
+ ".USRLAN_192." +
+
+ ".$frm->admin_button('update_options', USRLAN_51, 'submit')." +
"; + //$emessage = & eMessage :: getInstance(); + echo $mes->render().$text; + //$ns->tablerender(USRLAN_52,$emessage->render().$text); + } + + + +} + + +class users_admin_form_ui extends e_admin_form_ui +{ + + function user_perms($curval,$mode) + { + if($mode == 'read') + { + $uid = $this->getController()->getListModel()->get('user_id'); + return e107::getUserPerms()->renderPerms($curval,$uid); + } + if($mode == 'write') + { + $prm = e107::getUserPerms(); + $text = "Admin Permissions"; + $text .= "'; + return $text; + } + + + } + + function user_ban($curval,$mode) + { + $bo = array('Active',LAN_BANNED,LAN_NOTVERIFIED,LAN_BOUNCED); + + if($mode == 'filter' || $mode == 'batch') + { + return $bo; + } + if($mode == 'write') + { + $frm = e107::getForm(); + return $frm->selectbox('user_ban',$bo,$curval); + } + + return vartrue($bo[$curval],' '); // ($curval == 1) ? ADMIN_TRUE_ICON : ''; + } + + + function user_status($curval,$mode) + { + + $row = $this->getController()->getListModel()->getData(); + $text = ""; + if ($row['user_perms'] == "0") + { + $text .= "
".LAN_MAINADMIN."
"; + } + else + if ($row['user_admin']) + { + $text .= "
".LAN_ADMIN."
"; + } + else + if ($row['user_ban'] == 1) + { + $text .= "
".LAN_BANNED."
"; + } + else + if ($row['user_ban'] == 2) + { + $text .= "
".LAN_NOTVERIFIED."
"; + } + else + if ($row['user_ban'] == 3) + { + $text .= "
".LAN_BOUNCED."
"; + } + else + { + $text .= " "; + } + + return $text; + + + } + + + function options() // old drop-down options. + { + // return 'hello'; + $row = $this->getController()->getListModel()->getData(); + // $this->getController()->getListModel()-> + // return print_a($row,true); + + if(!getperms('4')) + { + // return; + } + + + extract($row); + $text .= "
+ + + +
"; + return $text; + + + + } +} + new users_admin(); +require_once ('auth.php'); + + + + + + + e107::getAdminUI()->runPage(); + + if (!e_QUERY) { // Determine the default based on perms. @@ -615,25 +1209,25 @@ if (!e_QUERY) switch ($action) { case "unverified" : - $user->show_existing_users($action,$sub_action,$id,$from,$amount); + // $user->show_existing_users($action,$sub_action,$id,$from,$amount); break; case "options" : if(getperms('4|U2')) { - $user->show_prefs(); + // $user->show_prefs(); } break; case "prune" : - $user->show_prune(); + // $user->show_prune(); // move to schedule tasks break; case "create" : if(getperms(('4|U1|U0'))) { - $userMethods->deleteExpired(); // Remove time-expired users - $user->user_add($user_data); + // $userMethods->deleteExpired(); // Remove time-expired users + // $user->user_add($user_data); } break; @@ -641,7 +1235,7 @@ switch ($action) case "ranks" : if(getperms(('4|U3'))) { - showRanks(); + // showRanks(); } break; @@ -649,10 +1243,14 @@ switch ($action) default : if(getperms('4|U1|U0')) { - $user->show_existing_users($action,$sub_action,$id,$from,$amount); + // $user->show_existing_users($action,$sub_action,$id,$from,$amount); } } + + +// --------------------------------------------------------------------- + require_once ("footer.php"); @@ -704,7 +1302,7 @@ class users unset ($pref['admin_user_disp']); save_prefs(); } - $this->usersSaveColumnPref(); + // $this->usersSaveColumnPref(); $this->fieldpref = (!$user_pref['admin_users_columns']) ? array('user_name','user_class') : $user_pref['admin_users_columns']; /* if (e_QUERY) @@ -775,7 +1373,7 @@ class users // print_a($this->fields); } - +/* function process_batch() { list($type,$tmp,$uclass) = explode("_",$_POST['execute_batch']); @@ -813,8 +1411,8 @@ class users } } } - - +*/ +/* function user_delete($userid,$confirm = false) { global $sql,$admin_log,$e_event,$ns; @@ -862,8 +1460,8 @@ class users } } } - - +*/ +/* FIXME banlist changes need to be integrated into the code above. function user_unban($userid) { global $sql,$admin_log; @@ -879,7 +1477,7 @@ class users $sub_action = "user_id"; } } - +*/ function user_activate($userid) { @@ -939,7 +1537,7 @@ class users } } - +/* function usersSaveColumnPref() { global $pref,$user_pref,$admin_log; @@ -1198,10 +1796,10 @@ class users else { $query = ''; - /* if ($action == 'unverified') - { - $query = 'user_ban = 2 '; - }*/ + // if ($action == 'unverified') + // { + // $query = 'user_ban = 2 '; + // } $qry_order = 'ORDER BY '.($sub_action ? $sub_action : 'user_id').' '.($id ? $id : 'DESC'); } @@ -1656,7 +2254,7 @@ class users ".$frm->password('password','',20,array('size'=>40,'class'=>'tbox e-password-admin'))." "; - /* + $text .= " ".USRLAN_63." @@ -1664,7 +2262,7 @@ class users ".$rs->form_password("password2",40,"",20)." "; - */ + $text .= " @@ -1726,7 +2324,7 @@ class users $ns->tablerender(USRLAN_59,$mes->render().$text); } - +*/ function resend($id,$key,$name,$email,$lfile = '') { global $sql,$mailheader_e107id,$admin_log; @@ -1769,6 +2367,7 @@ class users // ------- Ban User. -------------- + /* function user_ban($user_id) { global $sql,$user,$admin_log; @@ -1818,7 +2417,7 @@ class users $sub_action = "user_id"; } } - +*/ function resend_to_all() { @@ -2047,6 +2646,7 @@ class users // ------------------------------------------------------------------------ + /* function show_userclass($userid) { global $sql,$ns, $e_userclass; @@ -2077,7 +2677,7 @@ class users $ns->tablerender($caption,$text); } - +*/ /* Appears to be unused function @@ -2110,6 +2710,7 @@ class users */ // Set userclass for user(s). + /* function user_userclass($userid,$uclass,$mode=FALSE) { global $admin_log, $e_userclass; @@ -2182,7 +2783,7 @@ class users // $emessage->add("Update Failed", E_MESSAGE_ERROR); } } - +*/ } @@ -2498,10 +3099,11 @@ function showRanks() "; $text .= ''; - - $ns->tablerender(LAN_USER_RANKS,$emessage->render().$text); - include (e_ADMIN.'footer.php'); - exit; + echo $emessage->render().$text; + + // $ns->tablerender(LAN_USER_RANKS,$emessage->render().$text); + //include (e_ADMIN.'footer.php'); + //exit; } diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index e11bd03ec..72ef12150 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -1389,11 +1389,11 @@ class e_form { continue; } - elseif($data['type'] != 'method' && !$data['forced'] && !isset($fieldvalues[$field])) + elseif($data['type'] != 'method' && !$data['forced'] && !isset($fieldvalues[$field]) && $fieldvalues[$field] !== NULL) { $ret .= " - Not Found! + Not Found! ($field) "; @@ -1427,7 +1427,7 @@ class e_form } $value = $this->renderValue($field, varset($fieldvalues[$field]), $data, varset($fieldvalues[$pid])); - + if($tdclass) { $tdclass = ' class="'.$tdclass.'"'; @@ -1784,7 +1784,8 @@ class e_form case 'bool': case 'boolean': - $value = $value ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON; + $false = vartrue($parms['trueonly']) ? "" : ADMIN_FALSE_ICON; + $value = $value ? ADMIN_TRUE_ICON : $false; break; case 'url': @@ -1811,8 +1812,8 @@ class e_form $value = "".$ttl.""; break; - case 'method': // Custom Function - $method = $field; + case 'method': // Custom Function + $method = $attributes['field']; // prevents table alias in method names. ie. u.my_method. $value = call_user_func_array(array($this, $method), array($value, 'read', $parms)); break; diff --git a/e107_handlers/user_handler.php b/e107_handlers/user_handler.php index 7c24f8e72..25a67b383 100644 --- a/e107_handlers/user_handler.php +++ b/e107_handlers/user_handler.php @@ -836,7 +836,28 @@ e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_administrator.php"); class e_userperms { - protected $core_perms = array( + protected $core_perms = array(); + + protected $plugin_perms = array(); + + protected $language_perms = array(); + + protected $main_perms = array(); + + protected $full_perms = array(); + + protected $permSectionDiz = array( + 'core' => ADMSLAN_74, + 'plugin' => ADLAN_CL_7, + 'language' => ADLAN_132, + 'main' => ADMSLAN_58 + ); + + + function __construct() + { + require_once(e_ADMIN."ad_links.php"); + $this->core_perms = array( // In the same order as admin navigation! @@ -888,38 +909,19 @@ class e_userperms "2" => array(ADMSLAN_20,E_16_MENUS, E_32_MENUS), // Alter Menus - // "D"=> ADMSLAN_29, // Manage Banners (deprecated - now a plugin) - // "E"=> ADMSLAN_30, // News feed headlines (deprecated - now a plugin) - // "K"=> + // "D"=> ADMSLAN_29, // Manage Banners (deprecated - now a plugin) + // "E"=> ADMSLAN_30, // News feed headlines (deprecated - now a plugin) + // "K"=> - // "P" // Reserved for Plugins + // "P" // Reserved for Plugins - // "Q"=> array(ADMSLAN_24), // Manage download categories (deprecated - now a plugin) - // "R"=> ADMSLAN_44, // Post Downloads (deprecated) + // "Q"=> array(ADMSLAN_24), // Manage download categories (deprecated - now a plugin) + // "R"=> ADMSLAN_44, // Post Downloads (deprecated) - // "Z"=> ADMSLAN_62, // Plugin Manager.. included under Plugins category. - ); - - protected $plugin_perms = array(); - - protected $language_perms = array(); - - protected $main_perms = array(); + // "Z"=> ADMSLAN_62, // Plugin Manager.. included under Plugins category. + ); - protected $full_perms = array(); - - protected $permSectionDiz = array( - 'core' => ADMSLAN_74, - 'plugin' => ADLAN_CL_7, - 'language' => ADLAN_132, - 'main' => ADMSLAN_58 - ); - - - function __construct() - { - $sql = e107::getDb('sql2'); $tp = e107::getParser();