Ignore:
Timestamp:
Oct 9, 2009, 5:58:56 PM (15 years ago)
Author:
Eric
Message:

[Bug 1041] [REV 4008] Merged form trunk to branch

Coding guidelines improvement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/admin/user_list.php

    r3945 r4009  
    188188if ($conf['double_password_type_in_admin'] == true)
    189189{
    190         if (isset($_POST['submit_add']))
    191         {
    192                 if(empty($_POST['password']))
    193                 {
    194                         array_push($page['errors'], l10n('Password is missing'));
    195                 }
    196                 else if(empty($_POST['password_conf']))
    197                 {
    198                         array_push($page['errors'], l10n('Password confirmation is missing'));
    199                 }
    200                 else if(empty($_POST['email']))
    201                 {
    202                         array_push($page['errors'], l10n('Email address is missing'));
    203                 }
    204                 else if ($_POST['password'] != $_POST['password_conf'])
    205                 {
    206                         array_push($page['errors'], l10n('Password confirmation error'));
    207                 }
    208                 else
    209                 {
    210                 $page['errors'] = register_user(
    211                 $_POST['login'], $_POST['password'], $_POST['email'], false);
    212 
    213                         if (count($page['errors']) == 0)
    214                 {
    215                 array_push(
    216                         $page['infos'],
    217                         sprintf(
    218                                 l10n('user "%s" added'),
    219                                 $_POST['login']
    220                         )
    221                 );
    222                 }
    223                 }
    224         }
     190  if (isset($_POST['submit_add']))
     191  {
     192    if(empty($_POST['password']))
     193    {
     194      array_push($page['errors'], l10n('Password is missing'));
     195    }
     196    else if(empty($_POST['password_conf']))
     197    {
     198      array_push($page['errors'], l10n('Password confirmation is missing'));
     199    }
     200    else if(empty($_POST['email']))
     201    {
     202      array_push($page['errors'], l10n('Email address is missing'));
     203    }
     204    else if ($_POST['password'] != $_POST['password_conf'])
     205    {
     206      array_push($page['errors'], l10n('Password confirmation error'));
     207    }
     208    else
     209    {
     210      $page['errors'] = register_user(
     211        $_POST['login'], $_POST['password'], $_POST['email'], false);
     212
     213      if (count($page['errors']) == 0)
     214      {
     215        array_push(
     216          $page['infos'],
     217          sprintf(
     218            l10n('user "%s" added'),
     219            $_POST['login']
     220          )
     221        );
     222      }
     223    }
     224  }
    225225}
    226226else if ($conf['double_password_type_in_admin'] == false)
    227227{
    228         if (isset($_POST['submit_add']))
    229         {
    230         $page['errors'] = register_user(
    231         $_POST['login'], $_POST['password'], $_POST['email'], false);
    232 
    233         if (count($page['errors']) == 0)
    234         {
    235         array_push(
    236         $page['infos'],
    237         sprintf(
    238                 l10n('user "%s" added'),
    239                 $_POST['login']
    240                 )
    241         );
    242         }
     228  if (isset($_POST['submit_add']))
     229  {
     230    $page['errors'] = register_user(
     231      $_POST['login'], $_POST['password'], $_POST['email'], false);
     232
     233    if (count($page['errors']) == 0)
     234    {
     235      array_push(
     236        $page['infos'],
     237        sprintf(
     238          l10n('user "%s" added'),
     239          $_POST['login']
     240          )
     241        );
     242    }
    243243  }
    244244}
Note: See TracChangeset for help on using the changeset viewer.