Commit bd5c16ec authored by Dries's avatar Dries

- Patch #76653 by paranojik: adding and searching users was broken.

parent 567a82f0
......@@ -697,11 +697,11 @@ function user_menu($may_cache) {
);
$items[] = array('path' => 'admin/user/user', 'title' => t('users'),
'description' => t('List, add, and edit users.'),
'callback' => 'user_admin', 'access' => $admin_access);
'callback' => 'user_admin', 'callback arguments' => array('list'), 'access' => $admin_access);
$items[] = array('path' => 'admin/user/user/list', 'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/user/user/create', 'title' => t('add user'),
'callback' => 'user_admin', 'access' => $admin_access,
'callback' => 'user_admin', 'callback arguments' => array('create'), 'access' => $admin_access,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/user/settings', 'title' => t('user settings'),
'description' => t('Configure default behavior of users, including registration requirements, e-mails, and user pictures.'),
......@@ -739,7 +739,7 @@ function user_menu($may_cache) {
if (module_exist('search')) {
$items[] = array('path' => 'admin/user/search', 'title' => t('search users'),
'description' => t('Search users by name.'),
'callback' => 'user_admin', 'access' => $admin_access,
'callback' => 'user_admin', 'callback arguments' => array('search'), 'access' => $admin_access,
'type' => MENU_NORMAL_ITEM);
}
......@@ -1946,18 +1946,14 @@ function user_admin_settings() {
return system_settings_form('user_admin_settings', $form);
}
function user_admin() {
function user_admin($callback_arg = '') {
$edit = isset($_POST['edit']) ? $_POST['edit'] : '';
$op = isset($_POST['op']) ? $_POST['op'] : '';
if (empty($op)) {
$op = arg(2);
}
$op = isset($_POST['op']) ? $_POST['op'] : $callback_arg;
switch ($op) {
case 'search':
case t('Search'):
$output = search_form(url('admin/user/user/search'), $_POST['edit']['keys'], 'user') . search_data($_POST['edit']['keys'], 'user');
$output = search_form(url('admin/user/search'), $_POST['edit']['keys'], 'user') . search_data($_POST['edit']['keys'], 'user');
break;
case t('Create new account'):
case 'create':
......@@ -2007,7 +2003,7 @@ function user_help($section) {
<li>Anonymous user: this role is used for users that don\'t have a user account or that are not authenticated.</li>
<li>Authenticated user: this role is automatically granted to all logged in users.</li>
</ul>', array('%permissions' => url('admin/user/access/permissions')));
case 'admin/user/user/search':
case 'admin/user/search':
return t('<p>Enter a simple pattern ("*" may be used as a wildcard match) to search for a username. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda".</p>');
case 'user/help#user':
$site = variable_get('site_name', 'this website');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment