Conjunto de cambios d7a822e en sipes para cord/modules/user
- Fecha y hora:
- 23/05/2016 15:48:25 (hace 8 años)
- Branches:
- stable, version-3.0
- Children:
- 6f9ddf1
- Parents:
- b354002
- Ubicación:
- cord/modules/user
- Ficheros:
-
- 3 editados
Leyenda
- No modificado
- Añadido
- Eliminado
-
cord/modules/user/user.admin.inc
rb354002 rd7a822e 6 6 */ 7 7 8 /** 9 * Page callback: Generates the appropriate user administration form. 10 * 11 * This function generates the user registration, multiple user cancellation, 12 * or filtered user list admin form, depending on the argument and the POST 13 * form values. 14 * 15 * @param string $callback_arg 16 * (optional) Indicates which form to build. Defaults to '', which will 17 * trigger the user filter form. If the POST value 'op' is present, this 18 * function uses that value as the callback argument. 19 * 20 * @return string 21 * A renderable form array for the respective request. 22 */ 8 23 function user_admin($callback_arg = '') { 9 24 $op = isset($_POST['op']) ? $_POST['op'] : $callback_arg; -
cord/modules/user/user.info
rb354002 rd7a822e 5 5 core = 6.x 6 6 7 ; Information added by drupal.org packaging script on 2011-05-258 version = "6.2 2"7 ; Information added by packaging script on 2013-11-20 8 version = "6.29" 9 9 project = "drupal" 10 datestamp = "13 06357015"10 datestamp = "1384980946" 11 11 -
cord/modules/user/user.module
rb354002 rd7a822e 14 14 * We cannot use module_invoke() for this, because the arguments need to 15 15 * be passed by reference. 16 */ 17 function user_module_invoke($type, &$array, &$user, $category = NULL) { 16 * 17 * @param $op 18 * The operation to be passed as the first parameter of the hook function. 19 * @param $edit 20 * An associative array variable containing form values to be passed 21 * as the second parameter of the hook function. 22 * @param $account 23 * The user account object to be passed as the third parameter of the hook 24 * function. 25 * @param $category 26 * The category of user information being acted upon. 27 */ 28 function user_module_invoke($op, &$edit, &$account, $category = NULL) { 18 29 foreach (module_list() as $module) { 19 30 $function = $module .'_user'; 20 31 if (function_exists($function)) { 21 $function($ type, $array, $user, $category);32 $function($op, $edit, $account, $category); 22 33 } 23 34 } … … 195 206 * 196 207 * @param $account 197 * The $user object for the user to modify or add. If $user->uid is 198 * omitted, a new user will be added. 199 * 208 * The user object for to modify or add. If you want to modify an existing 209 * user account, you will need to ensure that (a) $account is an object, and 210 * (b) you have set $account->uid to the numeric user ID of the user account 211 * you wish to modify. Pass in NULL or any non-object to add a new user. 200 212 * @param $array 201 213 * (optional) An array of fields and values to save. For example, 202 * array('name' => 'My name'); Setting a field to NULL deletes it from 203 * the data column. 204 * 214 * array('name' => 'My name'); Keys that do not belong to columns 215 * in the user-related tables are added to the a serialized array 216 * in the 'data' column and will be loaded in the $user->data array by 217 * user_load(). Setting a field to NULL deletes it from the data column, 218 * if you are modifying an existing user account. 205 219 * @param $category 206 220 * (optional) The category for storing profile information in. … … 464 478 // Loop the number of times specified by $length. 465 479 for ($i = 0; $i < $length; $i++) { 480 do { 481 // Find a secure random number within the range needed. 482 $index = ord(drupal_random_bytes(1)); 483 } while ($index > $len); 466 484 467 485 // Each iteration, pick a random character from the 468 486 // allowable string and append it to the password: 469 $pass .= $allowable_characters[mt_rand(0, $len)]; 470 } 471 487 $pass .= $allowable_characters[$index]; 488 } 472 489 return $pass; 473 490 } … … 527 544 * Checks for usernames blocked by user administration. 528 545 * 529 * @return boolean TRUE for blocked users, FALSE for active. 546 * @param $name 547 * A string containing a name of the user. 548 * 549 * @return 550 * Object with property 'name' (the user name), if the user is blocked; 551 * FALSE if the user is not blocked. 530 552 */ 531 553 function user_is_blocked($name) { … … 586 608 $keys = preg_replace('!\*+!', '%', $keys); 587 609 if (user_access('administer users')) { 588 // Administrators can also search in the otherwise private email field. 610 // Administrators can also search in the otherwise private email 611 // field, and they don't need to be restricted to only active users. 589 612 $result = pager_query("SELECT name, uid, mail FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%') OR LOWER(mail) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys, $keys); 590 613 while ($account = db_fetch_object($result)) { … … 593 616 } 594 617 else { 595 $result = pager_query("SELECT name, uid FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys); 618 // Regular users can only search via user names, and we do not show 619 // them blocked accounts. 620 $result = pager_query("SELECT name, uid FROM {users} WHERE status = 1 AND LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys); 596 621 while ($account = db_fetch_object($result)) { 597 622 $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid, array('absolute' => TRUE))); … … 1077 1102 'page callback' => 'drupal_get_form', 1078 1103 'page arguments' => array('user_confirm_delete', 1), 1079 'access callback' => 'user_ access',1080 'access arguments' => array( 'administer users'),1104 'access callback' => 'user_delete_access', 1105 'access arguments' => array(1), 1081 1106 'type' => MENU_CALLBACK, 1082 1107 'file' => 'user.pages.inc', … … 2111 2136 * @param $account 2112 2137 * The user object of the account being notified. Must contain at 2113 * least the fields 'uid', 'name', and 'mail'.2138 * least the fields 'uid', 'name', 'pass', 'login', and 'mail'. 2114 2139 * @param $language 2115 2140 * Language object to generate the tokens with. … … 2167 2192 * 2168 2193 * @param $op 2169 * The operation being performed on the account. Possible values: 2170 * 'register_admin_created': Welcome message for user created by the admin 2171 * 'register_no_approval_required': Welcome message when user self-registers 2172 * 'register_pending_approval': Welcome message, user pending admin approval 2173 * 'password_reset': Password recovery request 2174 * 'status_activated': Account activated 2175 * 'status_blocked': Account blocked 2176 * 'status_deleted': Account deleted 2194 * The operation being performed on the account. Possible values: 2195 * - 'register_admin_created': Welcome message for user created by the admin. 2196 * - 'register_no_approval_required': Welcome message when user 2197 * self-registers. 2198 * - 'register_pending_approval': Welcome message, user pending admin 2199 * approval. 2200 * - 'password_reset': Password recovery request. 2201 * - 'status_activated': Account activated. 2202 * - 'status_blocked': Account blocked. 2203 * - 'status_deleted': Account deleted. 2177 2204 * 2178 2205 * @param $account 2179 * The user object of the account being notified.Must contain at2180 * least the fields 'uid', 'name', and 'mail'.2206 * The user object of the account being notified. Must contain at 2207 * least the fields 'uid', 'name', and 'mail'. 2181 2208 * @param $language 2182 * Optional language to use for the notification, overriding account language. 2209 * Optional language to use for the notification, overriding account language. 2210 * 2183 2211 * @return 2184 * The return value from drupal_mail_send(), if ends up being called.2212 * The return value from drupal_mail_send(), if ends up being called. 2185 2213 */ 2186 2214 function _user_mail_notify($op, $account, $language = NULL) { … … 2504 2532 2505 2533 function user_register_validate($form, &$form_state) { 2506 user_module_invoke('validate', $form_state['values'], $form_state['values'], 'account'); 2534 $account = (object) $form_state['values']; 2535 user_module_invoke('validate', $form_state['values'], $account, 'account'); 2507 2536 } 2508 2537 … … 2538 2567 return $destination == 'destination=user%2Flogin' ? 'destination=user' : $destination; 2539 2568 } 2569 2570 /** 2571 * Menu access callback; limit access to account deletion pages. 2572 * 2573 * Limit access to administrative users, and prevent the anonymous user account 2574 * from being deleted. 2575 */ 2576 function user_delete_access($account) { 2577 return user_access('administer users') && $account->uid > 0; 2578 }
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.