-
- ".$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 .= " ";
+
+
+
}
if($action == "unverified")
@@ -881,24 +978,22 @@ class users
$text .= " ".$tp->parseTemplate("{NEXTPREV={$parms}}");
}
- // Search - display options etc. .
+ // Search etc. .
- $text .= "
+
+
+
+ |