diff --git a/e107_admin/users.php b/e107_admin/users.php
index 30fa2e581..549e16636 100644
--- a/e107_admin/users.php
+++ b/e107_admin/users.php
@@ -9,10 +9,8 @@
*
* Administration Area - Users
*
-* $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
-* $Revision$
-* $Date$
-* $Author$
+* $URL$
+* $Id$
*
*/
require_once ('../class2.php');
@@ -99,7 +97,7 @@ $from = varset($from,0);
$amount = 30;
if ($action == 'ranks')
{
- show_ranks();
+ showRanks();
}
// ------- Check for Bounces --------------
$bounce_act = '';
@@ -284,14 +282,14 @@ if (isset ($_POST['adduser']))
$user_data = & $allData['data'];
if (!$error)
{
-
+
if(varset($_POST['perms']))
{
$allData['data']['user_admin'] = 1;
$allData['data']['user_perms'] = implode('.',$_POST['perms']);
}
-
-
+
+
$message = '';
$user_data['user_password'] = $userMethods->HashPassword($savePassword,$loginname);
$user_data['user_join'] = time();
@@ -439,12 +437,12 @@ if ((varset($_POST['useraction'])== "admin" || varset($_POST['useraction'])== "a
{
$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";
@@ -456,16 +454,16 @@ if ((varset($_POST['useraction'])== "admin" || varset($_POST['useraction'])== "a
{
$id = "DESC";
}
-
+
$prm->edit_administrator($row);
require_once ("footer.php");
exit;
}
-if (varset($_POST['update_admin'])) // Update admin Perms.
-{
- $prm->updatePerms($_POST['a_id'],$_POST['perms']);
+if (varset($_POST['update_admin'])) // Update admin Perms.
+{
+ $prm->updatePerms($_POST['a_id'],$_POST['perms']);
}
@@ -599,7 +597,7 @@ class users
'user_signature' => array('title' => LAN_USER_09,'type' => 'text','width' => 'auto'),
'user_hideemail' => array('title' => LAN_USER_10,'type' => 'boolean','width' => 'auto'),
'user_xup' => array('title' => LAN_USER_11,'type' => 'text','width' => 'auto'),
- 'user_class' => array('title' => LAN_USER_12,'type' => 'class'),
+ 'user_class' => array('title' => LAN_USER_12,'type' => 'class'),
'user_join' => array('title' => LAN_USER_14,'type' => 'date', 'width' => 'auto'),
'user_lastvisit' => array('title' => LAN_USER_15,'type' => 'date', 'width' => 'auto'),
'user_currentvisit' => array('title' => LAN_USER_16,'type' => 'date', 'width' => 'auto'),
@@ -631,30 +629,30 @@ class users
{
list($type,$tmp,$uclass) = explode("_",$_POST['execute_batch']);
$method = "user_".$type;
-
+
if($method == "user_remuserclass")
{
- $method = "user_userclass";
+ $method = "user_userclass";
}
if (method_exists($this,$method) && isset($_POST['user_selected']) )
{
foreach ($_POST['user_selected'] as $userid)
{
-
+
if($type=='userclass' || $type=='remuserclass')
- {
+ {
switch($type)
{
case 'userclass':
$mode = 'append';
break;
-
+
case 'remuserclass' :
$mode = ($uclass != '0') ? 'remove' : 'clear';
break;
}
-
+
$this->$method($userid,array($uclass),$mode);
}
else
@@ -1065,13 +1063,13 @@ class users
}
}
// $user_total = db_Count($table, $fields = '(*)',
-
+
if($_SESSION['filter']==e_UC_ADMIN)
{
$this->fieldpref[] = 'user_perms';
- }
-
-
+ }
+
+
$qry_insert = 'SELECT u.*, ue.* FROM `#user` AS u LEFT JOIN `#user_extended` AS ue ON ue.user_extended_id = u.user_id ';
return ($query) ? $qry_insert." WHERE ".$query.$qry_order : $qry_insert.$qry_order;
@@ -1080,15 +1078,15 @@ class users
function show_existing_users($action,$sub_action,$id,$from,$amount)
{
global $mySQLdefaultdb,$pref,$unverified,$userMethods;
-
+
$sql = e107::getDb();
$frm = e107::getForm();
$ns = e107::getRender();
$tp = e107::getParser();
-
+
$e107 = e107 :: getInstance();
$qry = $this->get_search_query();
-
+
$this->fieldpref = array_unique($this->fieldpref);
$text = "
".$this->show_search_filter();
@@ -1102,7 +1100,7 @@ class users
$frm->colGroup($this->fields,$this->fieldpref).
$frm->thead($this->fields,$this->fieldpref,"main.[FIELD].[ASC].[FROM]").
"
\n";
-
+
while ($row = $sql->db_Fetch())
{
@@ -1110,29 +1108,29 @@ class users
".$frm->checkbox('user_selected[]',$row['user_id'])." |
{$row['user_id']} | ";
-
+
foreach ($this->fieldpref as $disp)
{
- $class = vartrue($this->fields[$disp]['thclass']) ? "class='".$this->fields[$disp]['thclass']."'" : "";
+ $class = vartrue($this->fields[$disp]['thclass']) ? "class='".$this->fields[$disp]['thclass']."'" : "";
$text .= "".$this->renderValue($disp,$row)." | \n";
}
-
+
$text .= "
".$this->showUserOptions($row)." |
\n";
}
-
+
$text .= "
-
+
".$this->show_batch_options();
$users = (e_QUERY != "unverified") ? $sql->db_Count("user") : $unverified;
-
+
if ($users > $amount && !$_GET['srch'])
{
$parms = "{$users},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.user_id.desc.")."[FROM]";
$text .= $tp->parseTemplate("{NEXTPREV={$parms}}");
}
-
+
if ($action == "unverified")
{
$qry = (e_QUERY) ? "?".e_QUERY : "";
@@ -1150,7 +1148,7 @@ class users
$text .= "
";
-
+
$emessage = & eMessage :: getInstance();
$total_cap = (isset ($_GET['srch'])) ? $user_total : $users;
@@ -1166,8 +1164,8 @@ class users
$type = $this->fields[$key]['type'];
$pref = e107::getConfig()->getPref();
$prm = e107::getUserPerms();
-
- switch($key) // switch based on field.
+
+ switch($key) // switch based on field.
{
case 'user_class':
if ($row['user_class'])
@@ -1175,7 +1173,7 @@ class users
$tmp = explode(",",$row['user_class']);
while (list($key,$class_id) = each($tmp))
{
- $text .= $frm->uc_label($class_id)."
\n";
+ $text .= $frm->uc_label($class_id)."
\n";
}
return $text;
}
@@ -1184,7 +1182,7 @@ class users
return " ";
}
break;
-
+
case 'user_ip':
return $e107->ipDecode($row['user_ip']);
break;
@@ -1193,28 +1191,28 @@ class users
case 'user_status':
return $this->showUserStatus($row);
break;
-
+
case 'user_name':
- return "
{$row['user_name']}";
+ return "
{$row['user_name']}";
break;
-
- case 'user_perms': //TODO display link to popup window with editable perms.
- // return $row[$key].' ';
+
+ case 'user_perms': //TODO display link to popup window with editable perms.
+ // return $row[$key].' ';
return $prm->renderPerms($row[$key],$row['user_id']);
break;
-
+
case 'user_ban' :
return ($row[$key] == 1) ? ADMIN_TRUE_ICON : ''; // We may want to show more of the status later
break;
-
+
}
-
- switch($type) // switch based on type.
+
+ switch($type) // switch based on type.
{
case 'date':
return ($row[$key]) ? strftime($pref['shortdate'],$row[$key]).' ' : ' ';
break;
-
+
case 'boolean':
return ($row[$key] == 1) ? ADMIN_TRUE_ICON : '';
break;
@@ -1222,12 +1220,12 @@ class users
case 'user_status':
return $this->showUserStatus($row);
- break;
-
+ break;
+
}
-
+
return $row[$key].' ';
-
+
}
@@ -1238,7 +1236,7 @@ class users
$classObj = $e107->getUserClass();
$frm = new e_form();
$classes = $classObj->uc_get_classlist();
-
+
$assignClasses = array(); // Userclass list of userclasses that can be assigned
foreach ($classes as $key => $val)
@@ -1249,12 +1247,12 @@ class users
}
}
unset($assignClasses[0]);
-
-
+
+
$removeClasses = $assignClasses; // Userclass list of userclasses that can be removed
$removeClasses[0] = array('userclass_name'=>array('userclass_id'=>0, 'userclass_name'=>USRLAN_220));
-
-
+
+
if(count($assignClasses))
{
$uclasses = array(
@@ -1264,18 +1262,18 @@ class users
}
else
{
- $uclasses = FALSE;
- }
-
-
+ $uclasses = FALSE;
+ }
+
+
return $frm->batchoptions(
array(
'ban_selected' =>USRLAN_30,
'unban_selected' =>USRLAN_33,
'activate_selected' =>USRLAN_32,
'delete_selected' =>LAN_DELETE
- ),$uclasses
-
+ ),$uclasses
+
);
}
@@ -1305,8 +1303,8 @@ class users
$var ['unveri']['text'] = USRLAN_138." ($unverified)";
$var ['unveri']['link'] = e_ADMIN.'users.php?unverified';
}
- $var ['rank']['text'] = USRLAN_196;
- $var ['rank']['link'] = e_ADMIN.'users.php?ranks';
+ $var ['ranks']['text'] = USRLAN_196;
+ $var ['ranks']['link'] = e_ADMIN.'users.php?ranks';
// $var['mailing']['text']= USRLAN_121;
// $var['mailing']['link']="mailout.php";
show_admin_menu(USRLAN_76,$action,$var);
@@ -1453,16 +1451,16 @@ class users
function user_add($user_data)
{
global $rs,$pref,$e_userclass;
-
+
$prm = e107::getUserPerms();
$list = $prm->getPermList();
$frm = e107::getForm();
$ns = e107::getRender();
$mes = e107::getMessage();
-
- //TODO Better Password generation.
- // ie. a "Generate" button, which will place the text into the text field automatically.
-
+
+ //TODO Better Password generation.
+ // ie. a "Generate" button, which will place the text into the text field automatically.
+
if (!is_object($e_userclass))
$e_userclass = new user_class;
$text = "
".$rs->form_open("post",e_SELF.(e_QUERY ? '?'.e_QUERY : ''),"adduserform")."
@@ -1500,14 +1498,14 @@ class users
".$frm->checkbox_label(USRLAN_171,'generatepassword', 1)."
-
+
".USRLAN_63." |
".$rs->form_password("password2",40,"",20)."
|
-
+
".USRLAN_64." |
@@ -1519,14 +1517,14 @@ class users
| Require Confirmation |
".$frm->checkbox_label(USRLAN_181,'sendconfemail', 1)." |
";
-
+
//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 .= "
@@ -1539,32 +1537,32 @@ class users
\n";
}
-
- // Make Admin.
+
+ // Make Admin.
$text .= "
".USRLAN_35." |
Set Permissions
\n";
-
+
$groupedList = $prm->getPermList('grouped');
-
+
foreach($groupedList as $section=>$list)
{
- $text .= "\t\t ".$prm->renderSectionDiz($section).""; //XXX Lan - General
+ $text .= "\t\t ".$prm->renderSectionDiz($section).""; //XXX Lan - General
foreach($list as $key=>$diz)
{
- $text .= $prm->checkb($key, '', $diz);
+ $text .= $prm->checkb($key, '', $diz);
}
$text .= "";
}
$text .= " |
\n";
-
-
+
+
$text .= "
-
+