Skip to content

Commit

Permalink
move user_mgmnt to plugin/core/user
Browse files Browse the repository at this point in the history
  • Loading branch information
antonraharja committed Apr 17, 2014
1 parent 8b14e34 commit ff80d5d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions web/plugin/core/user/user_config.php
Expand Up @@ -49,7 +49,7 @@
$credit = rate_getusercredit($c_username);
} else {
$_SESSION['error_string'] = _('User does not exists').' ('._('username').': '.$uname.')';
header("Location: "._u('index.php?app=main&inc=user_mgmnt&op=user_list&view='.$view));
header("Location: "._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view='.$view));
exit();
}

Expand Down Expand Up @@ -163,8 +163,8 @@
if ($uname && auth_isadmin()) {
$content .= "<h2>" . _('Manage user') . "</h2>";
$option_credit = "<tr><td>" . _('Credit') . "</td><td><input type=text size=10 maxlength=10 name=up_credit value=\"$credit\"></td></tr>";
$button_delete = "<input type=button class=button value='" . _('Delete') . "' onClick=\"javascript: ConfirmURL('" . _('Are you sure you want to delete user ?') . " (" . _('username') . ": " . $c_username . ")','index.php?app=main&inc=user_mgmnt&op=user_del" . $url_uname . "&view=".$view."')\">";
$button_back = _back('index.php?app=main&inc=user_mgmnt&op=user_list&view='.$view);
$button_delete = "<input type=button class=button value='" . _('Delete') . "' onClick=\"javascript: ConfirmURL('" . _('Are you sure you want to delete user ?') . " (" . _('username') . ": " . $c_username . ")','index.php?app=main&inc=core_user&route=user_mgmnt&op=user_del" . $url_uname . "&view=".$view."')\">";
$button_back = _back('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view='.$view);
} else {
$content .= "<h2>" . _('User configuration') . "</h2>";
$option_credit = "<tr><td>" . _('Credit') . "</td><td>$credit</td></tr>";
Expand Down
Expand Up @@ -43,21 +43,21 @@
$search = themes_search($search_var);
$keywords = $search['dba_keywords'];
$count = dba_count(_DB_PREF_.'_tblUser', $conditions, $keywords);
$nav = themes_nav($count, "index.php?app=main&inc=user_mgmnt&op=user_list&view=".$view);
$nav = themes_nav($count, "index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=".$view);
$extras = array('ORDER BY' => 'register_datetime DESC, username', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']);
$list = dba_search(_DB_PREF_.'_tblUser', '*', $conditions, $keywords, $extras);
if ($err = $_SESSION['error_string']) {
$content = "<div class=error_string>$err</div>";
}
$content .= "
<h2>" . _('Manage user') . "</h2>
<input type='button' ".$disabled_on_admin." value='" . _('Administrators') . "' onClick=\"javascript:linkto('"._u('index.php?app=main&inc=user_mgmnt&op=user_list&view=admin')."')\" class=\"button\" />
<input type='button' ".$disabled_on_users." value='" . _('Normal users') . "' onClick=\"javascript:linkto('"._u('index.php?app=main&inc=user_mgmnt&op=user_list&view=users')."')\" class=\"button\" />
<input type='button' ".$disabled_on_admin." value='" . _('Administrators') . "' onClick=\"javascript:linkto('"._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=admin')."')\" class=\"button\" />
<input type='button' ".$disabled_on_users." value='" . _('Normal users') . "' onClick=\"javascript:linkto('"._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=users')."')\" class=\"button\" />
".$form_sub_title."
<p>".$search['form']."</p>
<div class=actions_box>
<div class=pull-left>
<a href=\""._u('index.php?app=main&inc=user_mgmnt&op=user_add&view='.$view)."\">".$icon_config['add']."</a>
<a href=\""._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_add&view='.$view)."\">".$icon_config['add']."</a>
</div>
<div class=pull-right>
</div>
Expand Down Expand Up @@ -85,17 +85,17 @@
if ($list[$i]['uid'] != '1' || $list[$i]['uid'] != $user_config['uid']) {
if (user_banned_get($list[$i]['uid'])) {
// unban
$action .= "<a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to unban user")) . " " . $list[$i]['username'] . " ?','"._u('index.php?app=main&inc=user_mgmnt&op=user_unban&uname='.$list[$i]['username'])."&view=".$view."')\">".$icon_config['unban']."</a>";
$action .= "<a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to unban user")) . " " . $list[$i]['username'] . " ?','"._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_unban&uname='.$list[$i]['username'])."&view=".$view."')\">".$icon_config['unban']."</a>";
$banned_icon = $icon_config['ban'];
} else {
// ban
$action .= "<a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to ban user")) . " " . $list[$i]['username'] . " ?','"._u('index.php?app=main&inc=user_mgmnt&op=user_ban&uname='.$list[$i]['username'])."&view=".$view."')\">".$icon_config['ban']."</a>";
$action .= "<a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to ban user")) . " " . $list[$i]['username'] . " ?','"._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_ban&uname='.$list[$i]['username'])."&view=".$view."')\">".$icon_config['ban']."</a>";
$banned_icon = '';
}
}

// remove user
$action .= "<a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to delete user")) . " " . $list[$i]['username'] . " ?','"._u('index.php?app=main&inc=user_mgmnt&op=user_del&uname='.$list[$i]['username'])."&view=".$view."')\">".$icon_config['user_delete']."</a>";
$action .= "<a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to delete user")) . " " . $list[$i]['username'] . " ?','"._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_del&uname='.$list[$i]['username'])."&view=".$view."')\">".$icon_config['user_delete']."</a>";

$j--;
$content .= "
Expand Down Expand Up @@ -154,7 +154,7 @@
$content .= "
<h2>"._('Manage user')."</h2>
<h3>".$form_sub_title."</h3>
<form action='index.php?app=main&inc=user_mgmnt&op=user_add_yes&view=".$view."' method=POST>
<form action='index.php?app=main&inc=core_user&route=user_mgmnt&op=user_add_yes&view=".$view."' method=POST>
"._CSRF_FORM_."
<table class=playsms-table>
<tbody>
Expand Down Expand Up @@ -195,7 +195,7 @@
</table>
<p><input type='submit' class='button' value='" . _('Save') . "'></p>
</form>
"._back('index.php?app=main&inc=user_mgmnt&op=user_list&view='.$view);
"._back('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view='.$view);
_p($content);
break;

Expand All @@ -213,7 +213,7 @@
$add['language_module'] = $_POST['add_language_module'];
$ret = user_add($add);
$_SESSION['error_string'] = $ret['error_string'];
header("Location: "._u('index.php?app=main&inc=user_mgmnt&op=user_add&view='.$view));
header("Location: "._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_add&view='.$view));
exit();
break;

Expand All @@ -222,7 +222,7 @@
$del_uid = user_username2uid($up['username']);
$ret = user_remove($del_uid);
$_SESSION['error_string'] = $ret['error_string'];
header("Location: "._u('index.php?app=main&inc=user_mgmnt&op=user_list&view='.$view));
header("Location: "._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view='.$view));
exit();
break;

Expand All @@ -239,7 +239,7 @@
} else {
$_SESSION['error_string'] = _('User is not on banned users list').' ('._('username').': '.$_REQUEST['uname'].')';
}
header("Location: "._u('index.php?app=main&inc=user_mgmnt&op=user_list&view='.$view));
header("Location: "._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view='.$view));
exit();
break;

Expand All @@ -256,7 +256,7 @@
$_SESSION['error_string'] = _('Unable to ban user').' ('._('username').': '.$_REQUEST['uname'].')';
}
}
header("Location: "._u('index.php?app=main&inc=user_mgmnt&op=user_list&view='.$view));
header("Location: "._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view='.$view));
exit();
break;
}
6 changes: 3 additions & 3 deletions web/plugin/core/user/user_pref.php
Expand Up @@ -46,7 +46,7 @@
$sender = core_sanitize_sender($c_user[0]['sender']);
} else {
$_SESSION['error_string'] = _('User does not exists').' ('._('username').': '.$uname.')';
header("Location: "._u('index.php?app=main&inc=user_mgmnt&op=user_list&view='.$view));
header("Location: "._u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view='.$view));
exit();
}

Expand All @@ -64,8 +64,8 @@
}
if ($uname && auth_isadmin()) {
$form_title = _('Manage user');
$button_delete = "<input type=button class=button value='" . _('Delete') . "' onClick=\"javascript: ConfirmURL('" . _('Are you sure you want to delete user ?') . " (" . _('username') . ": " . $c_username . ")','index.php?app=main&inc=user_mgmnt&op=user_del" . $url_uname . "&view=".$view."')\">";
$button_back = _back('index.php?app=main&inc=user_mgmnt&op=user_list&view='.$view);
$button_delete = "<input type=button class=button value='" . _('Delete') . "' onClick=\"javascript: ConfirmURL('" . _('Are you sure you want to delete user ?') . " (" . _('username') . ": " . $c_username . ")','index.php?app=main&inc=core_user&route=user_mgmnt&op=user_del" . $url_uname . "&view=".$view."')\">";
$button_back = _back('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view='.$view);
} else {
$form_title = _('Preferences');
}
Expand Down
2 changes: 1 addition & 1 deletion web/plugin/themes/common/config.php
Expand Up @@ -97,7 +97,7 @@
1
) ,
array(
'index.php?app=main&inc=user_mgmnt&op=user_list',
'index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list',
_('Manage user') ,
2
) ,
Expand Down

0 comments on commit ff80d5d

Please sign in to comment.