1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 05:07:27 +02:00

work on #14 - generic issue with form handler, started work on user admin area - work in progress

This commit is contained in:
SecretR
2012-11-28 15:11:17 +02:00
parent 65d3df0750
commit a5d436a3e3
2 changed files with 3188 additions and 3166 deletions

View File

@@ -15,6 +15,8 @@
*/
require_once ('../class2.php');
// Secretr FIXME move all triggers and pages inside the controller
if (!getperms('4|U0|U1|U2|U3') )
{
header('location:'.$e107->url->create('/'));
@@ -143,10 +145,10 @@ if (isset ($_POST['resend_to_all']))
$user->resend_to_all();
}
if (isset ($_POST['execute_batch']))
{
$user->process_batch();
}
// if (isset ($_POST['execute_batch']))
// {
// $user->process_batch();
// }
@@ -428,44 +430,50 @@ if (isset ($_POST['useraction']) && $_POST['useraction'] == "reqverify")
{
$sub_action = "user_id";
}
/*
}
if (isset ($_POST['useraction']) && $_POST['useraction'] == "ban")
$user->user_ban($_POST['userid']);
{
e107::getMessage()->addError('FIXME, I\'m not working...');
//$user->user_ban($_POST['userid']);
}
// ------- Unban User --------------
if (isset ($_POST['useraction']) && $_POST['useraction'] == "unban")
$user->user_unban($_POST['userid']);
{
e107::getMessage()->addError('FIXME, I\'m not working...');
//$user->user_unban($_POST['userid']);
}
if ((isset ($_POST['useraction']) && $_POST['useraction'] == "userinfo") || $_GET['userinfo'])
{
$ip = ($_POST['userip']) ? $_POST['userip'] : $_GET['userinfo'];
$user->user_info($ip);
}
// User Info.
// if ((isset ($_POST['useraction']) && $_POST['useraction'] == "userinfo") || $_GET['userinfo'])
// {
// $ip = ($_POST['userip']) ? $_POST['userip'] : $_GET['userinfo'];
// $user->user_info($ip);
// }
if (isset ($_POST['useraction']) && $_POST['useraction'] == 'deluser')
{
$user->user_delete($_POST['userid'],true);
}
// ------- Delete User --------------
// if (isset ($_POST['useraction']) && $_POST['useraction'] == 'deluser')
// {
// $user->user_delete($_POST['userid'],true);
// }
$user->user_userclass($_POST['userid'], $_POST['userclass'],'clear');
// ---- Update User's class --------------------
if (isset ($_POST['updateclass']))
{
e107::getMessage()->addError('FIXME, I\'m not working...');
//$user->user_userclass($_POST['userid'], $_POST['userclass'],'clear');
}
if (isset ($_POST['useraction']) && $_POST['useraction'] == 'userclass')
{
$user->show_userclass($_POST['userid']);
e107::getMessage()->addError('FIXME, I\'m not working...');
// header('location:'.e_ADMIN.'userclass.php?'.$e107->tp->toDB($_POST['userid'].'.'.e_QUERY));
*/
// exit;
//$user->show_userclass($_POST['userid']);
}
@@ -750,7 +758,21 @@ class users_admin_ui extends e_admin_ui
}
if(isset ($_POST['adduser']))
{
addUser();
}
// all old triggers come here for now
if(isset($_POST['useraction']))
{
switch ($_POST['useraction'])
{
case 'deluser':
if($_POST['userid'])
{
// map to the delete trigger - TODO quick and dirty fix, rewrite
$_POST['multiselect'] = array($_POST['userid'] => $_POST['userid']);
$_POST['etrigger_batch'] = 'delete';
}
break;
}
}
@@ -1162,7 +1184,8 @@ class users_admin_form_ui extends e_admin_form_ui
<input type='hidden' name='userid[{$user_id}]' value='{$user_id}' />
<input type='hidden' name='userip[{$user_id}]' value='{$user_ip}' />
<select name='useraction[{$user_id}]' onchange='this.form.submit()' class='tbox' style='width:75%'>
$text .= "<option value='userinfo'>".USRLAN_80."</option>
<option selected='selected' value=''>&nbsp;</option>";
if ($user_perms != "0")
{
// disabled user info <option value='userinfo'>".USRLAN_80."</option>
$text .= "
@@ -1506,7 +1529,7 @@ class users
require_once ("footer.php");
exit;
}
/* FIXME banlist changes need to be integrated into the code above.
}
}
*/
/* FIXME banlist changes need to be integrated into the code above. */
@@ -1522,7 +1545,7 @@ class users
$action = "main";
if (!$sub_action)
{
*/
$sub_action = "user_id";
}
}
@@ -2210,14 +2233,13 @@ class users
</table></form></div>";
$emessage = & eMessage :: getInstance();
$ns->tablerender(USRLAN_52,$emessage->render().$text);
}
$emessage = & eMessage :: getInstance();
$emessage->add($message,E_MESSAGE_SUCCESS);
*/
function show_message($message,$type = '')
{
e107::getMessage()->add($message,E_MESSAGE_SUCCESS);
}
/*
@@ -2412,7 +2434,7 @@ class users
$this->show_message(USRLAN_141.": ".$name);
}
}
/*
// ------- Ban User. --------------
/**/
@@ -2462,7 +2484,7 @@ class users
$action = "main";
if (!$sub_action)
{
*/
$sub_action = "user_id";
}
}
@@ -2755,7 +2777,7 @@ class users
$emessage->add(UCSLAN_9, E_MESSAGE_SUCCESS); // classes updated;
}
}
/*
*/
// Set userclass for user(s).
/**/
@@ -2828,7 +2850,7 @@ class users
}
else
{
*/
// $emessage->add("Update Failed", E_MESSAGE_ERROR);
}
}

View File

@@ -2425,7 +2425,7 @@ class e_form
$legend_class = vartrue($options['legend_class'], 'e-hideme');
$text .= "
<form class='method='post' action='{$formurl}' id='{$elid}-list-form'>
<form method='post' action='{$formurl}' id='{$elid}-list-form'>
<div>".$this->token()."
".vartrue($options['fieldset_pre'])."
<fieldset id='{$elid}-list'>