plugins/admin/UserManager.php
changeset 345 4ccdfeee9a11
parent 329 0437a7cf1acc
child 359 e0787bb6285b
equal deleted inserted replaced
344:be6c5fdd9203 345:4ccdfeee9a11
    34     
    34     
    35     $errors = array();
    35     $errors = array();
    36     
    36     
    37     if ( defined('ENANO_DEMO_MODE') )
    37     if ( defined('ENANO_DEMO_MODE') )
    38     {
    38     {
    39       $errors[] = 'Users cannot be modified or deleted in demo mode.';
    39       $errors[] = $lang->get('acpum_err_nosave_demo');
    40     }
    40     }
    41     
    41     
    42     $user_id = intval($_POST['user_id']);
    42     $user_id = intval($_POST['user_id']);
    43     if ( empty($user_id) || $user_id == 1 )
    43     if ( empty($user_id) || $user_id == 1 )
    44       $errors[] = 'Invalid user ID.';
    44       $errors[] = 'Invalid user ID.';
    49       if ( !$q )
    49       if ( !$q )
    50         $db->_die();
    50         $db->_die();
    51       $q = $db->sql_query('DELETE FROM '.table_prefix."users WHERE user_id=$user_id;");
    51       $q = $db->sql_query('DELETE FROM '.table_prefix."users WHERE user_id=$user_id;");
    52       if ( !$q )
    52       if ( !$q )
    53         $db->_die();
    53         $db->_die();
    54       echo '<div class="info-box">The user account has been deleted.</div>';
    54       echo '<div class="info-box">' . $lang->get('acpum_msg_delete_success') . '</div>';
    55     }
    55     }
    56     else
    56     else
    57     {
    57     {
    58       if ( $session->user_id == $user_id )
    58       if ( $session->user_id == $user_id )
    59       {
    59       {
    64       }
    64       }
    65       else
    65       else
    66       {
    66       {
    67         $username = $_POST['username'];
    67         $username = $_POST['username'];
    68         if ( !preg_match('#^'.$session->valid_username.'$#', $username) )
    68         if ( !preg_match('#^'.$session->valid_username.'$#', $username) )
    69           $errors[] = 'The username you entered contains invalid characters.';
    69           $errors[] = $lang->get('acpum_err_illegal_username');
    70         
    70         
    71         $password = false;
    71         $password = false;
    72         if ( $_POST['changing_pw'] == 'yes' )
    72         if ( $_POST['changing_pw'] == 'yes' )
    73         {
    73         {
    74           $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
    74           $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
    80             $data_hex = $_POST['crypt_data'];
    80             $data_hex = $_POST['crypt_data'];
    81             $password = $aes->decrypt($data_hex, $key_bin, ENC_HEX);
    81             $password = $aes->decrypt($data_hex, $key_bin, ENC_HEX);
    82           }
    82           }
    83           else
    83           else
    84           {
    84           {
    85             $errors[] = 'Session manager denied public encryption key lookup request';
    85             $errors[] = $lang->get('acpum_err_no_aes_key');
    86           }
    86           }
    87         }
    87         }
    88         
    88         
    89         $email = $_POST['email'];
    89         $email = $_POST['email'];
    90         if ( !preg_match('/^(?:[\w\d]+\.?)+@((?:(?:[\w\d]\-?)+\.)+\w{2,4}|localhost)$/', $email) )
    90         if ( !preg_match('/^(?:[\w\d]+\.?)+@((?:(?:[\w\d]\-?)+\.)+\w{2,4}|localhost)$/', $email) )
    91           $errors[] = 'You have entered an invalid e-mail address.';
    91           $errors[] = $lang->get('acpum_err_illegal_email');
    92         
    92         
    93         $real_name = $_POST['real_name'];
    93         $real_name = $_POST['real_name'];
    94       }
    94       }
    95       
    95       
    96       $signature = RenderMan::preprocess_text($_POST['signature'], true, true);
    96       $signature = RenderMan::preprocess_text($_POST['signature'], true, true);
   387                 $db->_die();
   387                 $db->_die();
   388               $session->add_user_to_group($user_id, GROUP_ID_MOD, false);
   388               $session->add_user_to_group($user_id, GROUP_ID_MOD, false);
   389             }
   389             }
   390           }
   390           }
   391           
   391           
   392           echo '<div class="info-box">Your changes have been saved.</div>';
   392           echo '<div class="info-box">' . $lang->get('acpum_msg_save_success') . '</div>';
   393         }
   393         }
   394       }
   394       }
   395     }
   395     }
   396     
   396     
   397     if ( count($errors) > 0 )
   397     if ( count($errors) > 0 )
   398     {
   398     {
   399       echo '<div class="error-box">
   399       echo '<div class="error-box">
   400               <b>Your request could not be processed due to the following validation errors:</b>
   400               <b>' . $lang->get('acpum_err_validation_fail') . '</b>
   401               <ul>
   401               <ul>
   402                 <li>' . implode("</li>\n        <li>", $errors) . '</li>
   402                 <li>' . implode("</li>\n        <li>", $errors) . '</li>
   403               </ul>
   403               </ul>
   404             </div>';
   404             </div>';
   405       $form = new Admin_UserManager_SmartForm();
   405       $form = new Admin_UserManager_SmartForm();
   453     if ( !$q )
   453     if ( !$q )
   454       $db->_die();
   454       $db->_die();
   455     
   455     
   456     if ( $db->numrows() < 1 )
   456     if ( $db->numrows() < 1 )
   457     {
   457     {
   458       echo '<div class="error-box">The username you entered could not be found.</div>';
   458       echo '<div class="error-box">' . $lang->get('acpum_err_bad_username') . '</div>';
   459     }
   459     }
   460     else
   460     else
   461     {
   461     {
   462       $row = $db->fetchrow();
   462       $row = $db->fetchrow();
   463       $row['user_id'] = $row['authoritative_uid'];
   463       $row['user_id'] = $row['authoritative_uid'];
   499   }
   499   }
   500   else if ( isset($_POST['action']['clear_sessions']) )
   500   else if ( isset($_POST['action']['clear_sessions']) )
   501   {
   501   {
   502     if ( defined('ENANO_DEMO_MODE') )
   502     if ( defined('ENANO_DEMO_MODE') )
   503     {
   503     {
   504       echo '<div class="error-box">Sorry Charlie, no can do. You might mess up other people logged into the demo site.</div>';
   504       echo '<div class="error-box">' . $lang->get('acpum_err_sessionclear_demo') . '</div>';
   505     }
   505     }
   506     else
   506     else
   507     {
   507     {
   508       // Get the current session information so the user doesn't get logged out
   508       // Get the current session information so the user doesn't get logged out
   509       $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
   509       $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
   532       $db->free_result($qb);
   532       $db->free_result($qb);
   533       
   533       
   534       $db->sql_query('DELETE FROM '.table_prefix.'session_keys;');
   534       $db->sql_query('DELETE FROM '.table_prefix.'session_keys;');
   535       $db->sql_query('INSERT INTO '.table_prefix.'session_keys( session_key,salt,user_id,auth_level,source_ip,time ) VALUES( \''.$ra['session_key'].'\', \''.$ra['salt'].'\', \''.$session->user_id.'\', \''.$ra['auth_level'].'\', \''.$ra['source_ip'].'\', '.$ra['time'].' ),( \''.$rb['session_key'].'\', \''.$rb['salt'].'\', \''.$session->user_id.'\', \''.$rb['auth_level'].'\', \''.$rb['source_ip'].'\', '.$rb['time'].' )');
   535       $db->sql_query('INSERT INTO '.table_prefix.'session_keys( session_key,salt,user_id,auth_level,source_ip,time ) VALUES( \''.$ra['session_key'].'\', \''.$ra['salt'].'\', \''.$session->user_id.'\', \''.$ra['auth_level'].'\', \''.$ra['source_ip'].'\', '.$ra['time'].' ),( \''.$rb['session_key'].'\', \''.$rb['salt'].'\', \''.$session->user_id.'\', \''.$rb['auth_level'].'\', \''.$rb['source_ip'].'\', '.$rb['time'].' )');
   536       
   536       
   537       echo '<div class="info-box">The session key table has been cleared. Your database should be a little bit smaller now.</div>';
   537       echo '<div class="info-box">' . $lang->get('acpum_msg_sessionclear_success') . '</div>';
   538     }
   538     }
   539   }
   539   }
   540   echo '<form action="' . makeUrlNS('Special', 'Administration', 'module=' . $paths->cpage['module'], true) . '" method="post" enctype="multipart/form-data" onsubmit="if ( !submitAuthorized ) return false;">';
   540   echo '<form action="' . makeUrlNS('Special', 'Administration', 'module=' . $paths->cpage['module'], true) . '" method="post" enctype="multipart/form-data" onsubmit="if ( !submitAuthorized ) return false;">';
   541   echo '<h3>User administration panel</h3>';
   541   echo '<h3>' . $lang->get('acpum_heading_main') . '</h3>';
   542   echo '<p>From this panel you can modify or delete user accounts.</p>';
   542   echo '<p>' . $lang->get('acpum_hint_intro') . '</p>';
   543   echo '<table border="0">
   543   echo '<table border="0">
   544           <tr>
   544           <tr>
   545             <td><b>Search for user:</b><br />
   545             <td><b>' . $lang->get('acpum_field_search_user') . '</b><br />
   546                 <small>If your browser supports AJAX, this will provide suggestions for you.</small>
   546                 <small>' . $lang->get('acpum_field_search_user_hint') . '</small>
   547                 </td>
   547                 </td>
   548             <td style="width: 10px;"></td>
   548             <td style="width: 10px;"></td>
   549             <td>' . $template->username_field('username') . '</td>
   549             <td>' . $template->username_field('username') . '</td>
   550             <td>
   550             <td>
   551               <input type="submit" name="action[go]" value="Go &raquo;" />
   551               <input type="submit" name="action[go]" value="' . $lang->get('acpum_btn_search_user_go') . ' &raquo;" />
   552             </td>
   552             </td>
   553           </tr>
   553           </tr>
   554         </table>';
   554         </table>';
   555   echo '<h3>Clear session key table</h3>';
   555   echo '<h3>' . $lang->get('acpum_heading_clear_sessions') . '</h3>';
   556   echo '<p>It\'s a good idea to clean out your session keys table every once in a while, since this helps to reduce database size. During this process you will be logged off and (hopefully) logged back on automatically. If you do this, all users besides you will be logged off, so be sure to do this at a time when traffic is low.</p>';
   556   echo '<p>' . $lang->get('acpum_hint_clear_sessions') . '</p>';
   557   echo '<p><input type="submit" name="action[clear_sessions]" value="Clear session keys" /></p>';
   557   echo '<p><input type="submit" name="action[clear_sessions]" value="' . $lang->get('acpum_btn_clear_sessions') . '" /></p>';
   558   echo '</form>';
   558   echo '</form>';
   559   
   559   
   560   if(isset($_GET['action']) && isset($_GET['user']))
   560   if(isset($_GET['action']) && isset($_GET['user']))
   561   {
   561   {
   562     switch($_GET['action'])
   562     switch($_GET['action'])
   563     {
   563     {
   564       case "activate":
   564       case "activate":
   565         $e = $db->sql_query('SELECT activation_key FROM '.table_prefix.'users WHERE username=\'' . $db->escape($_GET['user']) . '\'');
   565         $e = $db->sql_query('SELECT activation_key FROM '.table_prefix.'users WHERE username=\'' . $db->escape($_GET['user']) . '\'');
   566         if($e)
   566         if ( $e )
   567         {
   567         {
       
   568           // attempt to activate the account
   568           $row = $db->fetchrow();
   569           $row = $db->fetchrow();
   569           $db->free_result();
   570           $db->free_result();
   570           if($session->activate_account($_GET['user'], $row['activation_key'])) { echo '<div class="info-box">The user account "' . htmlspecialchars($_GET['user']) . '" has been activated.</div>'; $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid'])); }
   571           if ( $session->activate_account($_GET['user'], $row['activation_key']) )
   571           else echo '<div class="warning-box">The user account "' . htmlspecialchars($_GET['user']) . '" has NOT been activated, possibly because the account is already active.</div>';
   572           {
   572         } else echo '<div class="error-box">Error activating account: '.mysql_error().'</div>';
   573             echo '<div class="info-box">' . $lang->get('acpum_msg_activate_success', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
       
   574             $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid']));
       
   575           }
       
   576           else
       
   577           {
       
   578             echo '<div class="warning-box">' . $lang->get('acpum_err_activate_fail', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
       
   579           }
       
   580         }
       
   581         else
       
   582         {
       
   583           echo '<div class="error-box">Error activating account: '.$db->get_error().'</div>';
       
   584         }
   573         break;
   585         break;
   574       case "sendemail":
   586       case "sendemail":
   575         if($session->send_activation_mail($_GET['user'])) { echo '<div class="info-box">The user "' . htmlspecialchars($_GET['user']) . '" has been sent an e-mail with an activation link.</div>'; $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid'])); }
   587         if ( $session->send_activation_mail($_GET['user'] ) )
   576         else echo '<div class="error-box">The user account "' . htmlspecialchars($_GET['user']) . '" has not been activated, probably because of a bad SMTP configuration.</div>';
   588         {
       
   589           echo '<div class="info-box">' . $lang->get('acpum_msg_activate_email_success', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
       
   590           $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid']));
       
   591         }
       
   592         else
       
   593         {
       
   594           echo '<div class="error-box">' . $lang->get('acpum_err_activate_email_fail', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
       
   595         }
   577         break;
   596         break;
   578       case "deny":
   597       case "deny":
   579         $e = $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE log_type=\'admin\' AND action=\'activ_req\' AND time_id=\'' . $db->escape($_GET['logid']) . '\';');
   598         $e = $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE log_type=\'admin\' AND action=\'activ_req\' AND time_id=\'' . $db->escape($_GET['logid']) . '\';');
   580         if(!$e) echo '<div class="error-box">Error during row deletion: '.mysql_error().'</div>';
   599         if ( !$e )
   581         else echo '<div class="info-box">All activation requests for the user "' . htmlspecialchars($_GET['user']) . '" have been deleted.</div>';
   600         {
       
   601           echo '<div class="error-box">Error during row deletion: '.$db->get_error().'</div>';
       
   602         }
       
   603         else
       
   604         {
       
   605           echo '<div class="info-box">' . $lang->get('acpum_msg_activate_deny_success', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
       
   606         }
   582         break;
   607         break;
   583     }
   608     }
   584   }
   609   }
   585   $q = $db->sql_query('SELECT l.log_type, l.action, l.time_id, l.date_string, l.author, l.edit_summary, u.user_coppa FROM '.table_prefix.'logs AS l
   610   $q = $db->sql_query('SELECT l.log_type, l.action, l.time_id, l.date_string, l.author, l.edit_summary, u.user_coppa FROM '.table_prefix.'logs AS l
   586                          LEFT JOIN '.table_prefix.'users AS u
   611                          LEFT JOIN '.table_prefix.'users AS u
   589   if($q)
   614   if($q)
   590   {
   615   {
   591     if($db->numrows() > 0)
   616     if($db->numrows() > 0)
   592     {
   617     {
   593       $n = $db->numrows();
   618       $n = $db->numrows();
   594       if($n == 1) $s = $n . ' user is';
   619       $str = ( $n == 1 ) ?
   595       else $s = $n . ' users are';
   620         $lang->get('acpum_heading_activation_one') :
   596       echo '<h3>'.$s . ' awaiting account activation</h3>';
   621         $lang->get('acpum_heading_activation_plural', array('count' => strval($n)));
       
   622         
       
   623       echo '<h3>' . $str . '</h3>';
       
   624         
   597       echo '<div class="tblholder">
   625       echo '<div class="tblholder">
   598             <table border="0" cellspacing="1" cellpadding="4" width="100%">
   626               <table border="0" cellspacing="1" cellpadding="4" width="100%">
   599             <tr><th>Date of request</th><th>Requested by</th><th>Requested for</th><th>COPPA user</th><th colspan="3">Actions</th></tr>';
   627                 <tr>
       
   628                   <th>' . $lang->get('acpum_col_activate_timestamp') . '</th>
       
   629                   <th>' . $lang->get('acpum_col_activate_requestedby') . '</th>
       
   630                   <th>' . $lang->get('acpum_col_activate_requestedfor') . '</th>
       
   631                   <th>' . $lang->get('acpum_col_activate_coppauser') . '</th>
       
   632                   <th colspan="3">' . $lang->get('acpum_col_activate_actions') . '</th>
       
   633                 </tr>';
   600       $cls = 'row2';
   634       $cls = 'row2';
   601       while($row = $db->fetchrow())
   635       while($row = $db->fetchrow())
   602       {
   636       {
   603         if($cls == 'row2') $cls = 'row1';
   637         if($cls == 'row2') $cls = 'row1';
   604         else $cls = 'row2';
   638         else $cls = 'row2';
   605         $coppa = ( $row['user_coppa'] == '1' ) ? '<b>Yes</b>' : 'No';
   639         $coppa = ( $row['user_coppa'] == '1' ) ? '<b>' . $lang->get('acpum_coppauser_yes') . '</b>' : $lang->get('acpum_coppauser_no');
   606         echo '<tr><td class="'.$cls.'">'.date('F d, Y h:i a', $row['time_id']).'</td><td class="'.$cls.'">'.$row['author'].'</td><td class="'.$cls.'">'.$row['edit_summary'].'</td><td style="text-align: center;" class="' . $cls . '">' . $coppa . '</td><td class="'.$cls.'" style="text-align: center;"><a href="'.makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'UserManager&amp;action=activate&amp;user='.$row['edit_summary'].'&amp;logid='.$row['time_id']).'">Activate now</a></td><td class="'.$cls.'" style="text-align: center;"><a href="'.makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'UserManager&amp;action=sendemail&amp;user='.$row['edit_summary'].'&amp;logid='.$row['time_id']).'">Send activation e-mail</a></td><td class="'.$cls.'" style="text-align: center;"><a href="'.makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'UserManager&amp;action=deny&amp;user='.$row['edit_summary'].'&amp;logid='.$row['time_id']).'">Deny request</a></td></tr>';
   640         echo '<tr>
       
   641                 <td class="'.$cls.'">'.enano_date('F d, Y h:i a', $row['time_id']).'</td>
       
   642                 <td class="'.$cls.'">'.$row['author'].'</td>
       
   643                 <td class="'.$cls.'">'.$row['edit_summary'].'</td>
       
   644                 <td style="text-align: center;" class="' . $cls . '">' . $coppa . '</td>
       
   645                 <td class="'.$cls.'" style="text-align: center;">
       
   646                   <a href="'.makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'UserManager&action=activate&user='.rawurlencode($row['edit_summary']).'&logid='.$row['time_id'], true).'">' . $lang->get('acpum_btn_activate_now') . '</a>
       
   647                 </td>
       
   648                 <td class="'.$cls.'" style="text-align: center;">
       
   649                   <a href="'.makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'UserManager&action=sendemail&user='.rawurlencode($row['edit_summary']).'&logid='.$row['time_id'], true).'">' . $lang->get('acpum_btn_send_email') . '</a>
       
   650                 </td>
       
   651                 <td class="'.$cls.'" style="text-align: center;">
       
   652                   <a href="'.makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'UserManager&action=deny&user='.rawurlencode($row['edit_summary']).'&logid='.$row['time_id'], true).'">' . $lang->get('acpum_btn_activate_deny') . '</a>
       
   653                 </td>
       
   654               </tr>';
   607       }
   655       }
   608       echo '</table>';
   656       echo '</table>';
   609     }
   657     }
   610     $db->free_result();
   658     $db->free_result();
   611   }
   659   }
   766             <!-- BEGINNOT same_user -->
   814             <!-- BEGINNOT same_user -->
   767             if ( form.changing_pw.value == 'yes' )
   815             if ( form.changing_pw.value == 'yes' )
   768             {
   816             {
   769               if ( form.new_password.value != form.new_password_confirm.value )
   817               if ( form.new_password.value != form.new_password_confirm.value )
   770               {
   818               {
   771                 alert('The passwords you entered did not match.');
   819                 alert(\$lang.get('user_reg_err_alert_password_nomatch'));
   772                 return false;
   820                 return false;
   773               }
   821               }
   774               form.new_password_confirm.value = '';
   822               form.new_password_confirm.value = '';
   775               runEncryption();
   823               runEncryption();
   776             }
   824             }
   788             
   836             
   789               <!-- Heading -->
   837               <!-- Heading -->
   790             
   838             
   791               <tr>
   839               <tr>
   792                 <th colspan="2">
   840                 <th colspan="2">
   793                   Editing user: {USERNAME}
   841                   {lang:acpum_heading_editing_user} {USERNAME}
   794                 </th>
   842                 </th>
   795               </tr>
   843               </tr>
   796               
   844               
   797               <!-- Basic options (stored in enano_users) -->
   845               <!-- Basic options (stored in enano_users) -->
   798               
   846               
   799                 <tr>
   847                 <tr>
   800                   <th colspan="2" class="subhead">
   848                   <th colspan="2" class="subhead">
   801                     Basic options
   849                     {lang:acpum_heading_basic_options}
   802                   </th>
   850                   </th>
   803                 </tr>
   851                 </tr>
   804                 
   852                 
   805                 <tr>
   853                 <tr>
   806                   <td class="row2" style="width: 25%;">
   854                   <td class="row2" style="width: 25%;">
   807                     Username:<br />
   855                     {lang:acpum_field_username}<br />
   808                     <small>Must be at least 2 characters in length</small>
   856                     <small>{lang:acpum_field_username_hint}</small>
   809                   </td>
   857                   </td>
   810                   <td class="row1" style="width: 75%;">
   858                   <td class="row1" style="width: 75%;">
   811                     <input type="text" name="username" value="{USERNAME}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/><!-- BEGIN same_user --> <small>You cannot change your own username. To change your username you must log into a different administrative account.</small><!-- END same_user -->
   859                     <input type="text" name="username" value="{USERNAME}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/>
       
   860                     <!-- BEGIN same_user --><small>{lang:acpum_msg_same_user_username}</small><!-- END same_user -->
   812                   </td>
   861                   </td>
   813                 </tr>
   862                 </tr>
   814                 
   863                 
   815                 <tr>
   864                 <tr>
   816                   <td class="row2">
   865                   <td class="row2">
   817                     Password:
   866                     {lang:acpum_field_password}
   818                     <!-- BEGIN password_meter -->
   867                     <!-- BEGIN password_meter -->
   819                     <br />
   868                     <br />
   820                     <small>Password strength requirements are not enforced here.</small>
   869                     <small>{lang:acpum_field_password_hint}</small>
   821                     <!-- END password_meter -->
   870                     <!-- END password_meter -->
   822                   </td>
   871                   </td>
   823                   <td class="row1">
   872                   <td class="row1">
   824                     <div id="userform_{UUID}_pwlink">
   873                     <div id="userform_{UUID}_pwlink">
   825                       <b>Password will be left unchanged.</b> <a href="#" onclick="userform_{UUID}_chpasswd(); return false;">Reset password...</a>
   874                       <b>{lang:acpum_msg_password_unchanged}</b> <a href="#" onclick="userform_{UUID}_chpasswd(); return false;">{lang:acpum_btn_reset_password}</a>
   826                     </div>
   875                     </div>
   827                     <div id="userform_{UUID}_pwform" style="display: none;">
   876                     <div id="userform_{UUID}_pwform" style="display: none;">
   828                       <!-- BEGIN same_user -->
   877                       <!-- BEGIN same_user -->
   829                       To change your password, please use the user preferences panel. <a href="#" onclick="userform_{UUID}_chpasswd_cancel(); return false;">Cancel</a>
   878                         {lang:acpum_msg_same_user_password} <a href="#" onclick="userform_{UUID}_chpasswd_cancel(); return false;">{lang:etc_cancel}</a>
   830                       <!-- BEGINELSE same_user -->
   879                       <!-- BEGINELSE same_user -->
   831                       <input type="hidden" name="changing_pw" value="no" />
   880                       <input type="hidden" name="changing_pw" value="no" />
   832                       <input type="hidden" name="challenge_data" value="{MD5_CHALLENGE}" />
   881                       <input type="hidden" name="challenge_data" value="{MD5_CHALLENGE}" />
   833                       <input type="hidden" name="use_crypt" value="no" />
   882                       <input type="hidden" name="use_crypt" value="no" />
   834                       <input type="hidden" name="crypt_key" value="{PUBLIC_KEY}" />
   883                       <input type="hidden" name="crypt_key" value="{PUBLIC_KEY}" />
   835                       <input type="hidden" name="crypt_data" value="" />
   884                       <input type="hidden" name="crypt_data" value="" />
   836                       <table border="0" style="background-color: transparent;" cellspacing="0" cellpadding="0">
   885                       <table border="0" style="background-color: transparent;" cellspacing="0" cellpadding="0">
   837                         <tr>
   886                         <tr>
   838                           <td colspan="2">
   887                           <td colspan="2">
   839                             <b>Change password to:</b>
   888                             <b>{lang:acpum_field_password_title}</b>
   840                           </td>
   889                           </td>
   841                         </tr>
   890                         </tr>
   842                         <tr>
   891                         <tr>
   843                           <td>New password:</td>
   892                           <td>{lang:acpum_field_newpassword}</td>
       
   893                           <!-- FIXME: localize password strength widget -->
   844                           <td><input type="password" name="new_password" value="" <!-- BEGIN password_meter -->onkeyup="password_score_field(this);" /><span class="password-checker" style="font-weight: bold; color: #AA0000"> Weak (score: -10)</span><!-- BEGINELSE password_meter --> /><!-- END password_meter -->
   894                           <td><input type="password" name="new_password" value="" <!-- BEGIN password_meter -->onkeyup="password_score_field(this);" /><span class="password-checker" style="font-weight: bold; color: #AA0000"> Weak (score: -10)</span><!-- BEGINELSE password_meter --> /><!-- END password_meter -->
   845                             <!-- BEGIN password_meter -->
   895                             <!-- BEGIN password_meter -->
   846                               <div id="pwmeter" style="margin: 4px 0; height: 8px;"></div>
   896                               <div id="pwmeter" style="margin: 4px 0; height: 8px;"></div>
   847                             <!-- END password_meter -->
   897                             <!-- END password_meter -->
   848                           </td>
   898                           </td>
   849                         </tr>
   899                         </tr>
   850                         <tr>
   900                         <tr>
   851                           <td>Confirm:</td>
   901                           <td>{lang:acpum_field_newpassword_confirm}</td>
   852                           <td><input type="password" name="new_password_confirm" value="" /></td>
   902                           <td><input type="password" name="new_password_confirm" value="" /></td>
   853                         </tr>
   903                         </tr>
   854                         <tr>
   904                         <tr>
   855                           <td colspan="2">
   905                           <td colspan="2">
   856                             <a href="#" onclick="userform_{UUID}_chpasswd_cancel(); return false;">Cancel</a>
   906                             <a href="#" onclick="userform_{UUID}_chpasswd_cancel(); return false;">{lang:etc_cancel}</a>
   857                           </td>
   907                           </td>
   858                         </tr>
   908                         </tr>
   859                       </table>
   909                       </table>
   860                       <!-- END same_user -->
   910                       <!-- END same_user -->
   861                     </div>
   911                     </div>
   862                   </td>
   912                   </td>
   863                 </tr>
   913                 </tr>
   864                 
   914                 
   865                 <tr>
   915                 <tr>
   866                   <td class="row2" style="width: 25%;">
   916                   <td class="row2" style="width: 25%;">
   867                     E-mail address:
   917                     {lang:acpum_field_email}
   868                   </td>
   918                   </td>
   869                   <td class="row1" style="width: 75%;">
   919                   <td class="row1" style="width: 75%;">
   870                     <input type="text" name="email" value="{EMAIL}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/><!-- BEGIN same_user --> <small>To change your e-mail address, please use the user preferences panel.</small><!-- END same_user -->
   920                     <input type="text" name="email" value="{EMAIL}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/>
       
   921                     <!-- BEGIN same_user --><small>{lang:acpum_msg_same_user_email}</small><!-- END same_user -->
   871                   </td>
   922                   </td>
   872                 </tr>
   923                 </tr>
   873                 
   924                 
   874                 <tr>
   925                 <tr>
   875                   <td class="row2" style="width: 25%;">
   926                   <td class="row2" style="width: 25%;">
   876                     Real name:
   927                     {lang:acpum_field_realname}
   877                   </td>
   928                   </td>
   878                   <td class="row1" style="width: 75%;">
   929                   <td class="row1" style="width: 75%;">
   879                     <input type="text" name="real_name" value="{REAL_NAME}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/><!-- BEGIN same_user --> <small>To change your real name on file, please use the user preferences panel.</small><!-- END same_user -->
   930                     <input type="text" name="real_name" value="{REAL_NAME}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/>
       
   931                     <!-- BEGIN same_user --><small>{lang:acpum_msg_same_user_realname}</small><!-- END same_user -->
   880                   </td>
   932                   </td>
   881                 </tr>
   933                 </tr>
   882                 
   934                 
   883                 <tr>
   935                 <tr>
   884                   <td class="row2" style="width: 25%;">
   936                   <td class="row2" style="width: 25%;">
   885                     Signature:
   937                     {lang:acpum_field_signature}
   886                   </td>
   938                   </td>
   887                   <td class="row1" style="width: 75%;">
   939                   <td class="row1" style="width: 75%;">
   888                     {SIGNATURE_FIELD}
   940                     {SIGNATURE_FIELD}
   889                   </td>
   941                   </td>
   890                 </tr>
   942                 </tr>
   893               
   945               
   894               <!-- Extended options (anything in enano_users_extra) -->
   946               <!-- Extended options (anything in enano_users_extra) -->
   895               
   947               
   896                 <tr>
   948                 <tr>
   897                   <th class="subhead" colspan="2">
   949                   <th class="subhead" colspan="2">
   898                     Instant messenger contact information
   950                     {lang:acpum_heading_imcontact}
   899                   </th>
   951                   </th>
   900                 <tr>
   952                 <tr>
   901                   <td class="row2">AIM handle:</td>
   953                   <td class="row2">{lang:acpum_field_aim}</td>
   902                   <td class="row1"><input type="text" name="imaddr_aim" value="{IM_AIM}" size="30" /></td>
   954                   <td class="row1"><input type="text" name="imaddr_aim" value="{IM_AIM}" size="30" /></td>
   903                 </tr>
   955                 </tr>
   904                 <tr>
   956                 <tr>
   905                   <td class="row2"><acronym title="Windows&trade; Live Messenger">WLM</acronym> handle:<br /><small>If you don't specify the domain (@whatever.com), "@hotmail.com" will be assumed.</small></td>
   957                   <td class="row2">{lang:acpum_field_wlm}<br /><small>{lang:acpum_field_wlm_hint}</small></td>
   906                   <td class="row1"><input type="text" name="imaddr_msn" value="{IM_WLM}" size="30" /></td>
   958                   <td class="row1"><input type="text" name="imaddr_msn" value="{IM_WLM}" size="30" /></td>
   907                 </tr>
   959                 </tr>
   908                 <tr>
   960                 <tr>
   909                   <td class="row2">Yahoo! IM handle:</td>
   961                   <td class="row2">{lang:acpum_field_yim}</td>
   910                   <td class="row1"><input type="text" name="imaddr_yahoo" value="{IM_YAHOO}" size="30" /></td>
   962                   <td class="row1"><input type="text" name="imaddr_yahoo" value="{IM_YAHOO}" size="30" /></td>
   911                 </tr>
   963                 </tr>
   912                 <tr>
   964                 <tr>
   913                   <td class="row2">Jabber/XMPP handle:</td>
   965                   <td class="row2">{lang:acpum_field_xmpp}</td>
   914                   <td class="row1"><input type="text" name="imaddr_xmpp" value="{IM_XMPP}" size="30" /></td>
   966                   <td class="row1"><input type="text" name="imaddr_xmpp" value="{IM_XMPP}" size="30" /></td>
   915                 </tr>
   967                 </tr>
   916                 <tr>
   968                 <tr>
   917                   <th class="subhead" colspan="2">
   969                   <th class="subhead" colspan="2">
   918                     Extra contact information
   970                     {lang:acpum_heading_contact_extra}
   919                   </th>
   971                   </th>
   920                 </tr>
   972                 </tr>
   921                 <tr>
   973                 <tr>
   922                   <td class="row2">Homepage:<br /><small>Please remember the http:// prefix.</small></td>
   974                   <td class="row2">{lang:acpum_field_homepage}<br /><small>{lang:acpum_field_homepage_hint}</small></td>
   923                   <td class="row1"><input type="text" name="homepage" value="{HOMEPAGE}" size="30" /></td>
   975                   <td class="row1"><input type="text" name="homepage" value="{HOMEPAGE}" size="30" /></td>
   924                 </tr>
   976                 </tr>
   925                 <tr>
   977                 <tr>
   926                   <td class="row2">Location:</td>
   978                   <td class="row2">{lang:acpum_field_location}</td>
   927                   <td class="row1"><input type="text" name="location" value="{LOCATION}" size="30" /></td>
   979                   <td class="row1"><input type="text" name="location" value="{LOCATION}" size="30" /></td>
   928                 </tr>
   980                 </tr>
   929                 <tr>
   981                 <tr>
   930                   <td class="row2">Job:</td>
   982                   <td class="row2">{lang:acpum_field_job}</td>
   931                   <td class="row1"><input type="text" name="occupation" value="{JOB}" size="30" /></td>
   983                   <td class="row1"><input type="text" name="occupation" value="{JOB}" size="30" /></td>
   932                 </tr>
   984                 </tr>
   933                 <tr>
   985                 <tr>
   934                   <td class="row2">Hobbies:</td>
   986                   <td class="row2">{lang:acpum_field_hobbies}</td>
   935                   <td class="row1"><input type="text" name="hobbies" value="{HOBBIES}" size="30" /></td>
   987                   <td class="row1"><input type="text" name="hobbies" value="{HOBBIES}" size="30" /></td>
   936                 </tr>
   988                 </tr>
   937                 <tr>
   989                 <tr>
   938                   <td class="row2"><label for="chk_email_public_{UUID}">E-mail address is public</label><br /><small>If this is checked, the user's e-mail address will be displayed on your the page. To protect the address from spambots, it will be encrypted.</small></td>
   990                   <td class="row2"><label for="chk_email_public_{UUID}">{lang:acpum_field_email_public}</label><br /><small>{lang:acpum_field_email_public_hint}</small></td>
   939                   <td class="row1"><input type="checkbox" id="chk_email_public_{UUID}" name="email_public" <!-- BEGIN email_public -->checked="checked" <!-- END email_public -->size="30" /></td>
   991                   <td class="row1"><input type="checkbox" id="chk_email_public_{UUID}" name="email_public" <!-- BEGIN email_public -->checked="checked" <!-- END email_public -->size="30" /></td>
   940                 </tr>
   992                 </tr>
   941               
   993               
   942               <!-- / Extended options -->
   994               <!-- / Extended options -->
   943               
   995               
   944               <!-- Avatar settings -->
   996               <!-- Avatar settings -->
   945               
   997               
   946                 <tr>
   998                 <tr>
   947                   <th class="subhead" colspan="2">
   999                   <th class="subhead" colspan="2">
   948                     {lang:adminusers_avatar_heading}
  1000                     {lang:acpum_avatar_heading}
   949                   </th>
  1001                   </th>
   950                 </tr>
  1002                 </tr>
   951                 
  1003                 
   952                 <tr>
  1004                 <tr>
   953                   <td class="row2">
  1005                   <td class="row2">
   955                   </td>
  1007                   </td>
   956                   <td class="row1">
  1008                   <td class="row1">
   957                     <!-- BEGIN user_has_avatar -->
  1009                     <!-- BEGIN user_has_avatar -->
   958                       <img alt="{AVATAR_ALT}" src="{AVATAR_SRC}" />
  1010                       <img alt="{AVATAR_ALT}" src="{AVATAR_SRC}" />
   959                     <!-- BEGINELSE user_has_avatar -->
  1011                     <!-- BEGINELSE user_has_avatar -->
   960                       {lang:adminusers_avatar_image_none}
  1012                       {lang:acpum_avatar_image_none}
   961                     <!-- END user_has_avatar -->
  1013                     <!-- END user_has_avatar -->
   962                   </td>
  1014                   </td>
   963                 </tr>
  1015                 </tr>
   964                 
  1016                 
   965                 <tr>
  1017                 <tr>
   966                   <td class="row2">
  1018                   <td class="row2">
   967                     {lang:adminusers_avatar_lbl_change}
  1019                     {lang:acpum_avatar_lbl_change}
   968                   </td>
  1020                   </td>
   969                   <td class="row1">
  1021                   <td class="row1">
   970                     <script type="text/javascript">
  1022                     <script type="text/javascript">
   971                       function admincp_users_avatar_set_{UUID}(obj)
  1023                       function admincp_users_avatar_set_{UUID}(obj)
   972                       {
  1024                       {
   986                             $('avatar_upload_file_{UUID}').object.style.display = 'block';
  1038                             $('avatar_upload_file_{UUID}').object.style.display = 'block';
   987                             break;
  1039                             break;
   988                         }
  1040                         }
   989                       }
  1041                       }
   990                     </script>
  1042                     </script>
   991                     <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="keep" checked="checked" /> {lang:adminusers_avatar_lbl_keep}</label><br />
  1043                     <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="keep" checked="checked" /> {lang:acpum_avatar_lbl_keep}</label><br />
   992                     <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="remove" /> {lang:adminusers_avatar_lbl_remove}</label><br />
  1044                     <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="remove" /> {lang:acpum_avatar_lbl_remove}</label><br />
   993                     <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="set_http" /> {lang:adminusers_avatar_lbl_set_http}</label><br />
  1045                     <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="set_http" /> {lang:acpum_avatar_lbl_set_http}</label><br />
   994                       <div id="avatar_upload_http_{UUID}" style="display: none; margin: 10px 0 0 2.2em;">
  1046                       <div id="avatar_upload_http_{UUID}" style="display: none; margin: 10px 0 0 2.2em;">
   995                         {lang:usercp_avatar_lbl_url} <input type="text" name="avatar_http_url" size="40" value="http://" /><br />
  1047                         {lang:usercp_avatar_lbl_url} <input type="text" name="avatar_http_url" size="40" value="http://" /><br />
   996                         <small>{lang:usercp_avatar_lbl_url_desc} {lang:usercp_avatar_limits}</small>
  1048                         <small>{lang:usercp_avatar_lbl_url_desc} {lang:usercp_avatar_limits}</small>
   997                       </div>
  1049                       </div>
   998                     <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="set_file" /> {lang:adminusers_avatar_lbl_set_file}</label>
  1050                     <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="set_file" /> {lang:acpum_avatar_lbl_set_file}</label>
   999                       <div id="avatar_upload_file_{UUID}" style="display: none; margin: 10px 0 0 2.2em;">
  1051                       <div id="avatar_upload_file_{UUID}" style="display: none; margin: 10px 0 0 2.2em;">
  1000                         {lang:usercp_avatar_lbl_file} <input type="file" name="avatar_file" size="40" value="http://" /><br />
  1052                         {lang:usercp_avatar_lbl_file} <input type="file" name="avatar_file" size="40" value="http://" /><br />
  1001                         <small>{lang:usercp_avatar_lbl_file_desc} {lang:usercp_avatar_limits}</small>
  1053                         <small>{lang:usercp_avatar_lbl_file_desc} {lang:usercp_avatar_limits}</small>
  1002                       </div>
  1054                       </div>
  1003                   </td>
  1055                   </td>
  1007               
  1059               
  1008               <!-- Administrator-only options -->
  1060               <!-- Administrator-only options -->
  1009               
  1061               
  1010                 <tr>
  1062                 <tr>
  1011                   <th class="subhead" colspan="2">
  1063                   <th class="subhead" colspan="2">
  1012                     Administrator-only options
  1064                     {lang:acpum_heading_adminonly}
  1013                   </th>
  1065                   </th>
  1014                 </tr>
  1066                 </tr>
  1015                 
  1067                 
  1016                 <tr>
  1068                 <tr>
  1017                   <td class="row2">User account is active<br />
  1069                   <td class="row2">{lang:acpum_field_active_title}<br />
  1018                                    <small>If this is unchecked, the existing activation key will be overwritten in the database, thus invalidating any activation e-mails sent to the user.</small>
  1070                                    <small>{lang:acpum_field_active_hint}</small>
  1019                                    </td>
  1071                                    </td>
  1020                   <td class="row1"><label><input type="checkbox" name="account_active" <!-- BEGIN account_active -->checked="checked" <!-- END account_active -->/> Account is active and enabled</label></td>
  1072                   <td class="row1"><label><input type="checkbox" name="account_active" <!-- BEGIN account_active -->checked="checked" <!-- END account_active -->/> {lang:acpum_field_active}</label></td>
  1021                 </tr>
  1073                 </tr>
  1022                 
  1074                 
  1023                 <tr>
  1075                 <tr>
  1024                   <td class="row2">
  1076                   <td class="row2">
  1025                     User's site access level<br />
  1077                     {lang:acpum_field_userlevel}<br />
  1026                     <small>If this is changed, the relevant group memberships will be updated accordingly.</small>
  1078                     <small>{lang:acpum_field_userlevel_hint}</small>
  1027                   </td>
  1079                   </td>
  1028                   <td class="row1">
  1080                   <td class="row1">
  1029                     <select name="user_level">
  1081                     <select name="user_level">
  1030                       <option value="{USER_LEVEL_MEMBER}"<!-- BEGIN ul_member --> selected="selected"<!-- END ul_member -->>Normal member</option>
  1082                       <option value="{USER_LEVEL_MEMBER}"<!-- BEGIN ul_member --> selected="selected"<!-- END ul_member -->>{lang:userfuncs_ml_level_member}</option>
  1031                       <option value="{USER_LEVEL_MOD}"<!-- BEGIN ul_mod --> selected="selected"<!-- END ul_mod -->>Moderator</option>
  1083                       <option value="{USER_LEVEL_MOD}"<!-- BEGIN ul_mod --> selected="selected"<!-- END ul_mod -->>{lang:userfuncs_ml_level_mod}</option>
  1032                       <option value="{USER_LEVEL_ADMIN}"<!-- BEGIN ul_admin --> selected="selected"<!-- END ul_admin -->>Site administrator</option>
  1084                       <option value="{USER_LEVEL_ADMIN}"<!-- BEGIN ul_admin --> selected="selected"<!-- END ul_admin -->>{lang:userfuncs_ml_level_admin}</option>
  1033                     </select>
  1085                     </select>
  1034                   </td>
  1086                   </td>
  1035                 </tr>
  1087                 </tr>
  1036                 
  1088                 
  1037                 <tr>
  1089                 <tr>
  1038                   <td class="row2">
  1090                   <td class="row2">
  1039                     Delete user account
  1091                     {lang:acpum_field_deleteaccount_title}
  1040                   </td>
  1092                   </td>
  1041                   <td class="row1">
  1093                   <td class="row1">
  1042                     <label><input type="checkbox" name="delete_account" onclick="var d = (this.checked) ? 'block' : 'none'; document.getElementById('delete_blurb_{UUID}').style.display = d;" /> Permanently delete this user account when I click Save</label>
  1094                   <label><input type="checkbox" name="delete_account" onclick="var d = (this.checked) ? 'block' : 'none'; document.getElementById('delete_blurb_{UUID}').style.display = d;" /> {lang:acpum_field_deleteaccount}</label>
  1043                     <div id="delete_blurb_{UUID}" style="display: none;">
  1095                     <div id="delete_blurb_{UUID}" style="display: none;">
  1044                       <!-- BEGIN same_user -->
  1096                       <!-- BEGIN same_user -->
  1045                       <p><b><blink style="color: red;">WARNING!</blink> This will delete your own user account!</b></p>
  1097                       <!-- Obnoxious I know, but it's needed. -->
       
  1098                       <p><b>{lang:acpum_msg_delete_own_account}</b></p>
  1046                       <!-- END same_user -->
  1099                       <!-- END same_user -->
  1047                       <p><small>Even if you delete this user account, the username will be shown in page edit history, comments, and other areas of the site.
  1100                       <p><small>{lang:acpum_field_deleteaccount_hint}</small></p>
  1048                       Deleting a user account CANNOT BE UNDONE and should only be done in extreme circumstances.
       
  1049                       If the user has violated the site policy, deleting the account will not prevent him from using the site or creating a new account, for that you need to add a new ban rule.</small></p>
       
  1050                     </div>
  1101                     </div>
  1051                   </td>
  1102                   </td>
  1052                 </tr>
  1103                 </tr>
  1053                 </tr>
  1104                 </tr>
  1054               
  1105               
  1055               <!-- Save button -->
  1106               <!-- Save button -->
  1056               <tr>
  1107               <tr>
  1057                 <th colspan="2">
  1108                 <th colspan="2">
  1058                   <input type="submit" name="action[save]" value="Save changes" style="font-weight: bold;" />
  1109                   <input type="submit" name="action[save]" value="{lang:acpum_btn_save}" style="font-weight: bold;" />
  1059                   <input type="submit" name="action[noop]" value="Cancel" style="font-weight: normal;" />
  1110                   <input type="submit" name="action[noop]" value="{lang:etc_cancel}" style="font-weight: normal;" />
  1060                 </th>
  1111                 </th>
  1061               </tr>
  1112               </tr>
  1062             
  1113             
  1063             </table>
  1114             </table>
  1064           </div>
  1115           </div>