Conjunto de cambios d7a822e en sipes para cord/modules/user


Ignorar:
Fecha y hora:
23/05/2016 15:48:25 (hace 8 años)
Autor:
José Gregorio Puentes <jpuentes@…>
Branches:
stable, version-3.0
Children:
6f9ddf1
Parents:
b354002
Mensaje:

se agrego el directorio del cord

Ubicación:
cord/modules/user
Ficheros:
3 editados

Leyenda

No modificado
Añadido
Eliminado
  • cord/modules/user/user.admin.inc

    rb354002 rd7a822e  
    66 */
    77
     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 */
    823function user_admin($callback_arg = '') {
    924  $op = isset($_POST['op']) ? $_POST['op'] : $callback_arg;
  • cord/modules/user/user.info

    rb354002 rd7a822e  
    55core = 6.x
    66
    7 ; Information added by drupal.org packaging script on 2011-05-25
    8 version = "6.22"
     7; Information added by  packaging script on 2013-11-20
     8version = "6.29"
    99project = "drupal"
    10 datestamp = "1306357015"
     10datestamp = "1384980946"
    1111
  • cord/modules/user/user.module

    rb354002 rd7a822e  
    1414 * We cannot use module_invoke() for this, because the arguments need to
    1515 * 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 */
     28function user_module_invoke($op, &$edit, &$account, $category = NULL) {
    1829  foreach (module_list() as $module) {
    1930    $function = $module .'_user';
    2031    if (function_exists($function)) {
    21       $function($type, $array, $user, $category);
     32      $function($op, $edit, $account, $category);
    2233    }
    2334  }
     
    195206 *
    196207 * @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.
    200212 * @param $array
    201213 *   (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.
    205219 * @param $category
    206220 *   (optional) The category for storing profile information in.
     
    464478  // Loop the number of times specified by $length.
    465479  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);
    466484
    467485    // Each iteration, pick a random character from the
    468486    // allowable string and append it to the password:
    469     $pass .= $allowable_characters[mt_rand(0, $len)];
    470   }
    471 
     487    $pass .= $allowable_characters[$index];
     488  }
    472489  return $pass;
    473490}
     
    527544 * Checks for usernames blocked by user administration.
    528545 *
    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.
    530552 */
    531553function user_is_blocked($name) {
     
    586608        $keys = preg_replace('!\*+!', '%', $keys);
    587609        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.
    589612          $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);
    590613          while ($account = db_fetch_object($result)) {
     
    593616        }
    594617        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);
    596621          while ($account = db_fetch_object($result)) {
    597622            $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid, array('absolute' => TRUE)));
     
    10771102    'page callback' => 'drupal_get_form',
    10781103    '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),
    10811106    'type' => MENU_CALLBACK,
    10821107    'file' => 'user.pages.inc',
     
    21112136 * @param $account
    21122137 *  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'.
    21142139 * @param $language
    21152140 *  Language object to generate the tokens with.
     
    21672192 *
    21682193 * @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.
    21772204 *
    21782205 * @param $account
    2179  *  The user object of the account being notified. Must contain at
    2180  *  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'.
    21812208 * @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 *
    21832211 * @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.
    21852213 */
    21862214function _user_mail_notify($op, $account, $language = NULL) {
     
    25042532
    25052533function 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');
    25072536}
    25082537
     
    25382567  return $destination == 'destination=user%2Flogin' ? 'destination=user' : $destination;
    25392568}
     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 */
     2576function 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.