plugins/admin/UserManager.php
author Dan
Sat, 19 Jan 2008 00:32:41 -0500
changeset 356 9f8fca26ddb9
parent 345 4ccdfeee9a11
child 359 e0787bb6285b
permissions -rw-r--r--
Localized Admin:COPPA
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
     1
<?php
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
     2
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
     3
/*
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
     4
 * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
166
d53cc29308f4 Rebrand as 1.1.1; everything should now be bumped to "unstable" status
Dan
parents: 145
diff changeset
     5
 * Version 1.1.1
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
     6
 * Copyright (C) 2006-2007 Dan Fuhry
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
     7
 *
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
     8
 * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
     9
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    10
 *
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    11
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    12
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    13
 */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    14
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    15
function page_Admin_UserManager()
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    16
{
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    17
  global $db, $session, $paths, $template, $plugins; // Common objects
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
    18
  global $lang;
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    19
  if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    20
  {
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
    21
    $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
    22
    echo '<h3>' . $lang->get('adm_err_not_auth_title') . '</h3>';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
    23
    echo '<p>' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    24
    return;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    25
  }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    26
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    27
  //die('<pre>' . htmlspecialchars(print_r($_POST, true)) . '</pre>');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    28
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    29
  if ( isset($_POST['action']['save']) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    30
  {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    31
    #
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    32
    # BEGIN VALIDATION
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    33
    #
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    34
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    35
    $errors = array();
141
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
    36
    
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
    37
    if ( defined('ENANO_DEMO_MODE') )
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
    38
    {
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
    39
      $errors[] = $lang->get('acpum_err_nosave_demo');
141
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
    40
    }
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
    41
    
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    42
    $user_id = intval($_POST['user_id']);
141
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
    43
    if ( empty($user_id) || $user_id == 1 )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    44
      $errors[] = 'Invalid user ID.';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    45
    
141
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
    46
    if ( isset($_POST['delete_account']) && count($errors) < 1 )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    47
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    48
      $q = $db->sql_query('DELETE FROM '.table_prefix."users_extra WHERE user_id=$user_id;");
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    49
      if ( !$q )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    50
        $db->_die();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    51
      $q = $db->sql_query('DELETE FROM '.table_prefix."users WHERE user_id=$user_id;");
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    52
      if ( !$q )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    53
        $db->_die();
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
    54
      echo '<div class="info-box">' . $lang->get('acpum_msg_delete_success') . '</div>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    55
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    56
    else
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    57
    {
224
6a4573507ff8 Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
Dan
parents: 145
diff changeset
    58
      if ( $session->user_id == $user_id )
6a4573507ff8 Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
Dan
parents: 145
diff changeset
    59
      {
6a4573507ff8 Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
Dan
parents: 145
diff changeset
    60
        $username = $session->username;
6a4573507ff8 Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
Dan
parents: 145
diff changeset
    61
        $password = false;
6a4573507ff8 Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
Dan
parents: 145
diff changeset
    62
        $email = $session->email;
6a4573507ff8 Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
Dan
parents: 145
diff changeset
    63
        $real_name = $session->real_name;
6a4573507ff8 Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
Dan
parents: 145
diff changeset
    64
      }
6a4573507ff8 Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
Dan
parents: 145
diff changeset
    65
      else
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    66
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    67
        $username = $_POST['username'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    68
        if ( !preg_match('#^'.$session->valid_username.'$#', $username) )
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
    69
          $errors[] = $lang->get('acpum_err_illegal_username');
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    70
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    71
        $password = false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    72
        if ( $_POST['changing_pw'] == 'yes' )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    73
        {
286
b2f985e4cef3 Fixed a number of issues with SQL query readability and some undefined index-ish errors; consequently the SQL report feature was added
Dan
parents: 273
diff changeset
    74
          $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    75
          $key_hex_md5 = $_POST['crypt_key'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    76
          $key_hex = $session->fetch_public_key($key_hex_md5);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    77
          if ( $key_hex )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    78
          {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    79
            $key_bin = hexdecode($key_hex);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    80
            $data_hex = $_POST['crypt_data'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    81
            $password = $aes->decrypt($data_hex, $key_bin, ENC_HEX);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    82
          }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    83
          else
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    84
          {
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
    85
            $errors[] = $lang->get('acpum_err_no_aes_key');
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    86
          }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    87
        }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    88
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    89
        $email = $_POST['email'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    90
        if ( !preg_match('/^(?:[\w\d]+\.?)+@((?:(?:[\w\d]\-?)+\.)+\w{2,4}|localhost)$/', $email) )
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
    91
          $errors[] = $lang->get('acpum_err_illegal_email');
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    92
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    93
        $real_name = $_POST['real_name'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    94
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    95
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    96
      $signature = RenderMan::preprocess_text($_POST['signature'], true, true);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    97
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    98
      $user_level = intval($_POST['user_level']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
    99
      if ( $user_level < USER_LEVEL_MEMBER || $user_level > USER_LEVEL_ADMIN )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   100
        $errors[] = 'Invalid user level';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   101
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   102
      $imaddr_aim = htmlspecialchars($_POST['imaddr_aim']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   103
      $imaddr_msn = htmlspecialchars($_POST['imaddr_msn']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   104
      $imaddr_yahoo = htmlspecialchars($_POST['imaddr_yahoo']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   105
      $imaddr_xmpp = htmlspecialchars($_POST['imaddr_xmpp']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   106
      $homepage = htmlspecialchars($_POST['homepage']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   107
      $location = htmlspecialchars($_POST['location']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   108
      $occupation = htmlspecialchars($_POST['occupation']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   109
      $hobbies = htmlspecialchars($_POST['hobbies']);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   110
      $email_public = ( isset($_POST['email_public']) ) ? '1' : '0';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   111
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   112
      if ( !preg_match('/@([a-z0-9-]+)(\.([a-z0-9-\.]+))?/', $imaddr_msn) && !empty($imaddr_msn) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   113
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   114
        $imaddr_msn = "$imaddr_msn@hotmail.com";
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   115
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   116
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   117
      if ( substr($homepage, 0, 7) != 'http://' )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   118
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   119
        $homepage = "http://$homepage";
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   120
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   121
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   122
      if ( !preg_match('/^http:\/\/([a-z0-9-.]+)([A-z0-9@#\$%\&:;<>,\.\?=\+\(\)\[\]_\/\\\\]*?)$/i', $homepage) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   123
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   124
        $homepage = '';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   125
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   126
      
141
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   127
      if ( count($errors) < 1 )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   128
      {
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   129
        $q = $db->sql_query('SELECT u.user_level, u.user_has_avatar, u.avatar_type FROM '.table_prefix.'users AS u WHERE u.user_id = ' . $user_id . ';');
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   130
        if ( !$q )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   131
          $db->_die();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   132
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   133
        if ( $db->numrows() < 1 )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   134
        {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   135
          echo 'Couldn\'t select user data: no rows returned';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   136
        }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   137
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   138
        $row = $db->fetchrow();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   139
        $existing_level =& $row['user_level'];
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   140
        $avi_type =& $row['avatar_type'];
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   141
        $has_avi = ( $row['user_has_avatar'] == 1 );
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   142
        $db->free_result();
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   143
        
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   144
        $to_update_users = array();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   145
        if ( $user_id != $session->user_id )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   146
        {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   147
          $to_update_users['username'] = $username;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   148
          if ( $password )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   149
          {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   150
            $password = $aes->encrypt($password, $session->private_key, ENC_HEX);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   151
            $to_update_users['password'] = $password;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   152
          }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   153
          $to_update_users['email'] = $email;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   154
          $to_update_users['real_name'] = $real_name;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   155
        }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   156
        $to_update_users['signature'] = $signature;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   157
        $to_update_users['user_level'] = $user_level;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   158
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   159
        if ( isset($_POST['account_active']) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   160
        {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   161
          $to_update_users['account_active'] = "1";
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   162
        }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   163
        else
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   164
        {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   165
          $to_update_users['account_active'] = "0";
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   166
          $to_update_users['activation_key'] = sha1($session->dss_rand());
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   167
        }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   168
        
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   169
        // Avatar validation
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   170
        $action = ( isset($_POST['avatar_action']) ) ? $_POST['avatar_action'] : 'keep';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   171
        $avi_path = ENANO_ROOT . '/' . getConfig('avatar_directory') . '/' . $user_id . '.' . $avi_type;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   172
        switch($action)
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   173
        {
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   174
          case 'keep':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   175
          default:
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   176
            break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   177
          case 'remove':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   178
            if ( $has_avi )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   179
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   180
              // First switch the avatar off
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   181
              $to_update_users['user_has_avatar'] = '0';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   182
              @unlink($avi_path);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   183
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   184
            break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   185
          case 'set_http':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   186
          case 'set_file':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   187
            // Hackish way to preserve the UNIX philosophy of reusing as much code as possible
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   188
            if ( $action == 'set_http' )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   189
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   190
              // Check if this action is enabled
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   191
              if ( getConfig('avatar_upload_http') !== '1' )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   192
              {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   193
                // non-localized, only appears on hack attempt
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   194
                $errors[] = 'Uploads over HTTP are disabled.';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   195
                break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   196
              }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   197
              // Download the file
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   198
              require_once( ENANO_ROOT . '/includes/http.php' );
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   199
              
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   200
              if ( !preg_match('/^http:\/\/([a-z0-9-\.]+)(:([0-9]+))?\/(.+)$/', $_POST['avatar_http_url'], $match) )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   201
              {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   202
                $errors[] = $lang->get('usercp_avatar_invalid_url');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   203
                break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   204
              }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   205
              
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   206
              $hostname = $match[1];
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   207
              $uri = '/' . $match[4];
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   208
              $port = ( $match[3] ) ? intval($match[3]) : 80;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   209
              $max_size = intval(getConfig('avatar_max_size'));
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   210
              
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   211
              // Get temporary file
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   212
              $tempfile = tempnam(false, "enanoavatar_{$user_id}");
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   213
              if ( !$tempfile )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   214
                $errors[] = 'Error getting temp file.';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   215
              
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   216
              @unlink($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   217
              $request = new Request_HTTP($hostname, $uri, 'GET', $port);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   218
              $result = $request->write_response_to_file($tempfile, 50, $max_size);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   219
              if ( !$result || $request->response_code != HTTP_OK )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   220
              {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   221
                @unlink($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   222
                $errors[] = $lang->get('usercp_avatar_bad_write');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   223
                break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   224
              }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   225
              
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   226
              // Response written. Proceed to validation...
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   227
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   228
            else
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   229
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   230
              // Check if this action is enabled
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   231
              if ( getConfig('avatar_upload_file') !== '1' )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   232
              {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   233
                // non-localized, only appears on hack attempt
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   234
                $errors[] = 'Uploads from the browser are disabled.';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   235
                break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   236
              }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   237
              
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   238
              $max_size = intval(getConfig('avatar_max_size'));
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   239
              
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   240
              $file =& $_FILES['avatar_file'];
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   241
              $tempfile =& $file['tmp_name'];
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   242
              if ( filesize($tempfile) > $max_size )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   243
              {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   244
                @unlink($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   245
                $errors[] = $lang->get('usercp_avatar_file_too_large');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   246
                break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   247
              }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   248
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   249
            $file_type = get_image_filetype($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   250
            if ( !$file_type )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   251
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   252
              unlink($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   253
              $errors[] = $lang->get('usercp_avatar_bad_filetype');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   254
              break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   255
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   256
            
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   257
            $avi_path_new = ENANO_ROOT . '/' . getConfig('avatar_directory') . '/' . $user_id . '.' . $file_type;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   258
            
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   259
            // The file type is good - validate dimensions and animation
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   260
            switch($file_type)
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   261
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   262
              case 'png':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   263
                $is_animated = is_png_animated($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   264
                $dimensions = png_get_dimensions($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   265
                break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   266
              case 'gif':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   267
                $is_animated = is_gif_animated($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   268
                $dimensions = gif_get_dimensions($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   269
                break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   270
              case 'jpg':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   271
                $is_animated = false;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   272
                $dimensions = jpg_get_dimensions($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   273
                break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   274
              default:
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   275
                $errors[] = 'API mismatch';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   276
                break 2;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   277
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   278
            // Did we get invalid size data? If so the image is probably corrupt.
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   279
            if ( !$dimensions )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   280
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   281
              @unlink($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   282
              $errors[] = $lang->get('usercp_avatar_corrupt_image');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   283
              break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   284
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   285
            // Is the image animated?
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   286
            if ( $is_animated && getConfig('avatar_enable_anim') !== '1' )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   287
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   288
              @unlink($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   289
              $errors[] = $lang->get('usercp_avatar_disallowed_animation');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   290
              break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   291
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   292
            // Check image dimensions
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   293
            list($image_x, $image_y) = $dimensions;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   294
            $max_x = intval(getConfig('avatar_max_width'));
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   295
            $max_y = intval(getConfig('avatar_max_height'));
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   296
            if ( $image_x > $max_x || $image_y > $max_y )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   297
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   298
              @unlink($tempfile);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   299
              $errors[] = $lang->get('usercp_avatar_too_large');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   300
              break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   301
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   302
            // All good!
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   303
            @unlink($avi_path);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   304
            if ( rename($tempfile, $avi_path_new) )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   305
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   306
              $to_update_users['user_has_avatar'] = '1';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   307
              $to_update_users['avatar_type'] = $file_type;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   308
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   309
            else
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   310
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   311
              // move failed - turn avatar off
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   312
              $to_update_users['user_has_avatar'] = '0';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   313
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   314
            break;
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   315
        }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   316
        
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   317
        if ( count($errors) < 1 )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   318
        {
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   319
          $to_update_users_extra = array();
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   320
          $to_update_users_extra['user_aim'] = $imaddr_aim;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   321
          $to_update_users_extra['user_msn'] = $imaddr_msn;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   322
          $to_update_users_extra['user_yahoo'] = $imaddr_yahoo;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   323
          $to_update_users_extra['user_xmpp'] = $imaddr_xmpp;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   324
          $to_update_users_extra['user_homepage'] = $homepage;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   325
          $to_update_users_extra['user_location'] = $location;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   326
          $to_update_users_extra['user_job'] = $occupation;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   327
          $to_update_users_extra['user_hobbies'] = $hobbies;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   328
          $to_update_users_extra['email_public'] = ( $email_public ) ? '1' : '0';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   329
          
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   330
          $update_sql = '';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   331
          
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   332
          foreach ( $to_update_users as $key => $unused_crap )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   333
          {
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   334
            $value =& $to_update_users[$key];
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   335
            $value = $db->escape($value);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   336
            $update_sql .= ( empty($update_sql) ? '' : ',' ) . "$key='$value'";
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   337
          }
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   338
          
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   339
          $update_sql = 'UPDATE '.table_prefix."users SET $update_sql WHERE user_id=$user_id;";
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   340
          
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   341
          $update_sql_extra = '';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   342
          
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   343
          foreach ( $to_update_users_extra as $key => $unused_crap )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   344
          {
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   345
            $value =& $to_update_users_extra[$key];
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   346
            $value = $db->escape($value);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   347
            $update_sql_extra .= ( empty($update_sql_extra) ? '' : ',' ) . "$key='$value'";
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   348
          }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   349
          
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   350
          $update_sql_extra = 'UPDATE '.table_prefix."users_extra SET $update_sql_extra WHERE user_id=$user_id;";
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   351
          
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   352
          if ( !$db->sql_query($update_sql) )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   353
            $db->_die();
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   354
          
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   355
          if ( !$db->sql_query($update_sql_extra) )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   356
            $db->_die();
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   357
          
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   358
          if ( $existing_level != $user_level )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   359
          {
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   360
            // We need to update group memberships
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   361
            if ( $existing_level == USER_LEVEL_ADMIN ) 
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   362
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   363
              $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,edit_summary,author,page_text) VALUES(\'security\',\'u_from_admin\',' . time() . ',"' . $db->escape($_SERVER['REMOTE_ADDR']) . '","' . $db->escape($session->username) . '","' . $db->escape($username) . '");');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   364
              if ( !$q )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   365
                $db->_die();
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   366
              $session->remove_user_from_group($user_id, GROUP_ID_ADMIN);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   367
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   368
            else if ( $existing_level == USER_LEVEL_MOD ) 
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   369
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   370
              $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,edit_summary,author,page_text) VALUES(\'security\',\'u_from_mod\',' . time() . ',"' . $db->escape($_SERVER['REMOTE_ADDR']) . '","' . $db->escape($session->username) . '","' . $db->escape($username) . '");');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   371
              if ( !$q )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   372
                $db->_die();
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   373
              $session->remove_user_from_group($user_id, GROUP_ID_MOD);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   374
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   375
            
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   376
            if ( $user_level == USER_LEVEL_ADMIN )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   377
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   378
              $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,edit_summary,author,page_text) VALUES(\'security\',\'u_to_admin\',' . time() . ',"' . $db->escape($_SERVER['REMOTE_ADDR']) . '","' . $db->escape($session->username) . '","' . $db->escape($username) . '");');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   379
              if ( !$q )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   380
                $db->_die();
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   381
              $session->add_user_to_group($user_id, GROUP_ID_ADMIN, false);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   382
            }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   383
            else if ( $user_level == USER_LEVEL_MOD )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   384
            {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   385
              $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,edit_summary,author,page_text) VALUES(\'security\',\'u_to_mod\',' . time() . ',"' . $db->escape($_SERVER['REMOTE_ADDR']) . '","' . $db->escape($session->username) . '","' . $db->escape($username) . '");');
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   386
              if ( !$q )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   387
                $db->_die();
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   388
              $session->add_user_to_group($user_id, GROUP_ID_MOD, false);
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   389
            }
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   390
          }
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   391
          
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   392
          echo '<div class="info-box">' . $lang->get('acpum_msg_save_success') . '</div>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   393
        }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   394
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   395
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   396
    
141
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   397
    if ( count($errors) > 0 )
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   398
    {
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   399
      echo '<div class="error-box">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   400
              <b>' . $lang->get('acpum_err_validation_fail') . '</b>
141
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   401
              <ul>
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   402
                <li>' . implode("</li>\n        <li>", $errors) . '</li>
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   403
              </ul>
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   404
            </div>';
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   405
      $form = new Admin_UserManager_SmartForm();
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   406
      $form->user_id = $user_id;
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   407
      $form->username = $username;
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   408
      $form->email = $email;
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   409
      $form->real_name = $real_name;
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   410
      $form->signature = $signature;
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   411
      $form->user_level = $user_level;
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   412
      $form->im = array(
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   413
          'aim' => $imaddr_aim,
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   414
          'yahoo' => $imaddr_yahoo,
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   415
          'msn' => $imaddr_msn,
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   416
          'xmpp' => $imaddr_xmpp
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   417
        );
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   418
      $form->contact = array(
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   419
          'homepage' => $homepage,
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   420
          'location' => $location,
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   421
          'job' => $occupation,
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   422
          'hobbies' => $hobbies
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   423
        );
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   424
      $form->email_public = ( isset($_POST['email_public']) );
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   425
      $form->account_active = ( isset($_POST['account_active']) );
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   426
      echo $form->render();
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   427
      return false;
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   428
    }
13a43f08ffe1 SECURITY: Anonymous user can't be edited now; user accounts could be deleted even if errors detected; user CP saving disabled for demo mode
Dan
parents: 140
diff changeset
   429
    
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   430
    #
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   431
    # END VALIDATION
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   432
    #
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   433
  }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   434
  else if ( isset($_POST['action']['go']) || ( isset($_GET['src']) && $_GET['src'] == 'get' ) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   435
  {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   436
    if ( isset($_GET['user']) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   437
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   438
      $username =& $_GET['user'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   439
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   440
    else if ( isset($_POST['username']) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   441
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   442
      $username =& $_POST['username'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   443
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   444
    else
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   445
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   446
      echo 'No username provided';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   447
      return false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   448
    }
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   449
    $q = $db->sql_query('SELECT u.user_id AS authoritative_uid, u.username, u.email, u.real_name, u.signature, u.account_active, u.user_level, u.user_has_avatar, u.avatar_type, x.* FROM '.table_prefix.'users AS u
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   450
                           LEFT JOIN '.table_prefix.'users_extra AS x
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   451
                             ON ( u.user_id = x.user_id OR x.user_id IS NULL )
320
112debff64bd SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents: 317
diff changeset
   452
                           WHERE ( ' . ENANO_SQLFUNC_LOWERCASE . '(u.username) = \'' . $db->escape(strtolower($username)) . '\' OR u.username = \'' . $db->escape($username) . '\' ) AND u.user_id != 1;');
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   453
    if ( !$q )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   454
      $db->_die();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   455
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   456
    if ( $db->numrows() < 1 )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   457
    {
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   458
      echo '<div class="error-box">' . $lang->get('acpum_err_bad_username') . '</div>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   459
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   460
    else
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   461
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   462
      $row = $db->fetchrow();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   463
      $row['user_id'] = $row['authoritative_uid'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   464
      $form = new Admin_UserManager_SmartForm();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   465
      $form->user_id   = $row['user_id'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   466
      $form->username  = $row['username'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   467
      $form->email     = $row['email'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   468
      $form->real_name = $row['real_name'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   469
      $form->signature = $row['signature'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   470
      $form->user_level= $row['user_level'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   471
      $form->account_active = ( $row['account_active'] == 1 );
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   472
      $form->email_public   = ( $row['email_public'] == 1 );
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   473
      $form->has_avatar     = ( $row['user_has_avatar'] == 1 );
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   474
      $form->avi_type       = $row['avatar_type'];
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   475
      $form->im = array(
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   476
          'aim' => $row['user_aim'],
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   477
          'yahoo' => $row['user_yahoo'],
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   478
          'msn' => $row['user_msn'],
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   479
          'xmpp' => $row['user_xmpp']
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   480
        );
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   481
      $form->contact = array(
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   482
          'homepage' => $row['user_homepage'],
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   483
          'location' => $row['user_location'],
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   484
          'job'      => $row['user_job'],
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   485
          'hobbies'  => $row['user_hobbies'],
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   486
        );
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   487
      $form->email_public = ( $row['email_public'] == 1 );
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   488
      $html = $form->render();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   489
      if ( !$html )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   490
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   491
        echo 'Internal error: form processor returned false';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   492
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   493
      else
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   494
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   495
        echo $html;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   496
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   497
      return true;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   498
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   499
  }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   500
  else if ( isset($_POST['action']['clear_sessions']) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   501
  {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   502
    if ( defined('ENANO_DEMO_MODE') )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   503
    {
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   504
      echo '<div class="error-box">' . $lang->get('acpum_err_sessionclear_demo') . '</div>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   505
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   506
    else
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   507
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   508
      // Get the current session information so the user doesn't get logged out
286
b2f985e4cef3 Fixed a number of issues with SQL query readability and some undefined index-ish errors; consequently the SQL report feature was added
Dan
parents: 273
diff changeset
   509
      $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   510
      $sk = md5(strrev($session->sid_super));
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   511
      $qb = $db->sql_query('SELECT session_key,salt,auth_level,source_ip,time FROM '.table_prefix.'session_keys WHERE session_key=\''.$sk.'\' AND user_id='.$session->user_id.' AND auth_level='.USER_LEVEL_ADMIN);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   512
      if ( !$qb )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   513
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   514
        die('Error selecting session key info block B: '.$db->get_error());
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   515
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   516
      if ( $db->numrows($qb) < 1 )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   517
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   518
        die('Error: cannot read admin session info block B, aborting table clear process');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   519
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   520
      $qa = $db->sql_query('SELECT session_key,salt,auth_level,source_ip,time FROM '.table_prefix.'session_keys WHERE session_key=\''.md5($session->sid).'\' AND user_id='.$session->user_id.' AND auth_level='.USER_LEVEL_MEMBER);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   521
      if ( !$qa )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   522
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   523
        die('Error selecting session key info block A: '.$db->get_error());
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   524
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   525
      if ( $db->numrows($qa) < 1 )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   526
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   527
        die('Error: cannot read user session info block A, aborting table clear process');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   528
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   529
      $ra = $db->fetchrow($qa);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   530
      $rb = $db->fetchrow($qb);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   531
      $db->free_result($qa);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   532
      $db->free_result($qb);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   533
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   534
      $db->sql_query('DELETE FROM '.table_prefix.'session_keys;');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   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'].' )');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   536
      
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   537
      echo '<div class="info-box">' . $lang->get('acpum_msg_sessionclear_success') . '</div>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   538
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   539
  }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   540
  echo '<form action="' . makeUrlNS('Special', 'Administration', 'module=' . $paths->cpage['module'], true) . '" method="post" enctype="multipart/form-data" onsubmit="if ( !submitAuthorized ) return false;">';
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   541
  echo '<h3>' . $lang->get('acpum_heading_main') . '</h3>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   542
  echo '<p>' . $lang->get('acpum_hint_intro') . '</p>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   543
  echo '<table border="0">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   544
          <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   545
            <td><b>' . $lang->get('acpum_field_search_user') . '</b><br />
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   546
                <small>' . $lang->get('acpum_field_search_user_hint') . '</small>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   547
                </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   548
            <td style="width: 10px;"></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   549
            <td>' . $template->username_field('username') . '</td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   550
            <td>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   551
              <input type="submit" name="action[go]" value="' . $lang->get('acpum_btn_search_user_go') . ' &raquo;" />
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   552
            </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   553
          </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   554
        </table>';
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   555
  echo '<h3>' . $lang->get('acpum_heading_clear_sessions') . '</h3>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   556
  echo '<p>' . $lang->get('acpum_hint_clear_sessions') . '</p>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   557
  echo '<p><input type="submit" name="action[clear_sessions]" value="' . $lang->get('acpum_btn_clear_sessions') . '" /></p>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   558
  echo '</form>';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   559
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   560
  if(isset($_GET['action']) && isset($_GET['user']))
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   561
  {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   562
    switch($_GET['action'])
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   563
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   564
      case "activate":
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   565
        $e = $db->sql_query('SELECT activation_key FROM '.table_prefix.'users WHERE username=\'' . $db->escape($_GET['user']) . '\'');
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   566
        if ( $e )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   567
        {
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   568
          // attempt to activate the account
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   569
          $row = $db->fetchrow();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   570
          $db->free_result();
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   571
          if ( $session->activate_account($_GET['user'], $row['activation_key']) )
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   572
          {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   573
            echo '<div class="info-box">' . $lang->get('acpum_msg_activate_success', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   574
            $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid']));
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   575
          }
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   576
          else
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   577
          {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   578
            echo '<div class="warning-box">' . $lang->get('acpum_err_activate_fail', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   579
          }
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   580
        }
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   581
        else
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   582
        {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   583
          echo '<div class="error-box">Error activating account: '.$db->get_error().'</div>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   584
        }
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   585
        break;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   586
      case "sendemail":
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   587
        if ( $session->send_activation_mail($_GET['user'] ) )
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   588
        {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   589
          echo '<div class="info-box">' . $lang->get('acpum_msg_activate_email_success', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   590
          $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid']));
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   591
        }
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   592
        else
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   593
        {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   594
          echo '<div class="error-box">' . $lang->get('acpum_err_activate_email_fail', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   595
        }
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   596
        break;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   597
      case "deny":
221
e5302cb1945c Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents: 166
diff changeset
   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']) . '\';');
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   599
        if ( !$e )
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   600
        {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   601
          echo '<div class="error-box">Error during row deletion: '.$db->get_error().'</div>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   602
        }
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   603
        else
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   604
        {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   605
          echo '<div class="info-box">' . $lang->get('acpum_msg_activate_deny_success', array('username' => htmlspecialchars($_GET['user']))) . '</div>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   606
        }
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   607
        break;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   608
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   609
  }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   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
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   611
                         LEFT JOIN '.table_prefix.'users AS u
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   612
                           ON ( u.username = l.edit_summary OR u.username IS NULL )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   613
                         WHERE log_type=\'admin\' AND action=\'activ_req\' ORDER BY time_id DESC;');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   614
  if($q)
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   615
  {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   616
    if($db->numrows() > 0)
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   617
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   618
      $n = $db->numrows();
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   619
      $str = ( $n == 1 ) ?
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   620
        $lang->get('acpum_heading_activation_one') :
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   621
        $lang->get('acpum_heading_activation_plural', array('count' => strval($n)));
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   622
        
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   623
      echo '<h3>' . $str . '</h3>';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   624
        
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   625
      echo '<div class="tblholder">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   626
              <table border="0" cellspacing="1" cellpadding="4" width="100%">
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   627
                <tr>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   628
                  <th>' . $lang->get('acpum_col_activate_timestamp') . '</th>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   629
                  <th>' . $lang->get('acpum_col_activate_requestedby') . '</th>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   630
                  <th>' . $lang->get('acpum_col_activate_requestedfor') . '</th>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   631
                  <th>' . $lang->get('acpum_col_activate_coppauser') . '</th>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   632
                  <th colspan="3">' . $lang->get('acpum_col_activate_actions') . '</th>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   633
                </tr>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   634
      $cls = 'row2';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   635
      while($row = $db->fetchrow())
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   636
      {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   637
        if($cls == 'row2') $cls = 'row1';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   638
        else $cls = 'row2';
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   639
        $coppa = ( $row['user_coppa'] == '1' ) ? '<b>' . $lang->get('acpum_coppauser_yes') . '</b>' : $lang->get('acpum_coppauser_no');
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   640
        echo '<tr>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   641
                <td class="'.$cls.'">'.enano_date('F d, Y h:i a', $row['time_id']).'</td>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   642
                <td class="'.$cls.'">'.$row['author'].'</td>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   643
                <td class="'.$cls.'">'.$row['edit_summary'].'</td>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   644
                <td style="text-align: center;" class="' . $cls . '">' . $coppa . '</td>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   645
                <td class="'.$cls.'" style="text-align: center;">
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   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>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   647
                </td>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   648
                <td class="'.$cls.'" style="text-align: center;">
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   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>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   650
                </td>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   651
                <td class="'.$cls.'" style="text-align: center;">
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   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>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   653
                </td>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   654
              </tr>';
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   655
      }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   656
      echo '</table>';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   657
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   658
    $db->free_result();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   659
  }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   660
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   661
}
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   662
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   663
/**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   664
 * Smart form class for the user manager.
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   665
 * @package Enano
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   666
 * @subpackage Administration
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   667
 */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   668
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   669
class Admin_UserManager_SmartForm
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   670
{
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   671
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   672
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   673
   * Universally Unique Identifier (UUID) for this editor instance. Used to unique-itize Javascript functions and whatnot.
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   674
   * @var string
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   675
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   676
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   677
  var $uuid = '';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   678
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   679
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   680
   * User ID that we're editing.
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   681
   * @var int
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   682
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   683
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   684
  var $user_id = 0;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   685
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   686
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   687
   * Username
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   688
   * @var string
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   689
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   690
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   691
  var $username = '';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   692
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   693
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   694
   * E-mail address
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   695
   * @var string
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   696
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   697
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   698
  var $email = '';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   699
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   700
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   701
   * Real name
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   702
   * @var string
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   703
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   704
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   705
  var $real_name = '';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   706
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   707
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   708
   * Signature
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   709
   * @var string
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   710
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   711
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   712
  var $signature = '';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   713
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   714
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   715
   * IM contact information
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   716
   * @var array
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   717
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   718
   
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   719
  var $im = array();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   720
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   721
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   722
   * Real-life contact info
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   723
   * @var array
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   724
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   725
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   726
  var $contact = array();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   727
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   728
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   729
   * User level
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   730
   * @var int
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   731
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   732
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   733
  var $user_level = USER_LEVEL_MEMBER;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   734
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   735
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   736
   * Account activated
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   737
   * @var bool
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   738
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   739
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   740
  var $account_active = true;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   741
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   742
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   743
   * Email public switch
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   744
   * @var bool
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   745
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   746
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   747
  var $email_public = false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   748
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   749
  /**
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   750
   * Whether the user has an avatar or not.
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   751
   * @var bool
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   752
   */
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   753
  
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   754
  var $has_avatar = false;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   755
  
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   756
  /**
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   757
   * The type of avatar the user has. One of "jpg", "png", or "gif".
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   758
   * @var string
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   759
   */
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   760
  
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   761
  var $avi_type = 'png';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   762
  
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   763
  /**
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   764
   * Constructor.
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   765
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   766
  
286
b2f985e4cef3 Fixed a number of issues with SQL query readability and some undefined index-ish errors; consequently the SQL report feature was added
Dan
parents: 273
diff changeset
   767
  function Admin_UserManager_SmartForm()
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   768
  {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   769
    $this->uuid = md5( mt_rand() . microtime() );
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   770
  }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   771
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   772
  /**
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   773
   * Renders and returns the finished form.
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   774
   * @return string
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   775
   */
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   776
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   777
  function render()
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   778
  {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   779
    global $db, $session, $paths, $template, $plugins; // Common objects
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   780
    global $lang;
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   781
    if ( file_exists( ENANO_ROOT . "/themes/$template->theme/admin_usermanager_form.tpl" ) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   782
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   783
      $parser = $template->makeParser('admin_usermanager_form.tpl');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   784
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   785
    else
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   786
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   787
      $tpl_code = <<<EOF
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   788
      <!-- Start of user edit form -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   789
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   790
        <script type="text/javascript">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   791
          function userform_{UUID}_chpasswd()
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   792
          {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   793
            var link = document.getElementById('userform_{UUID}_pwlink');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   794
            var form = document.getElementById('userform_{UUID}_pwform');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   795
            domOpacity(link, 100, 0, 500);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   796
            domObjChangeOpac(0, form);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   797
            setTimeout("var link = document.getElementById('userform_{UUID}_pwlink'); var form = document.getElementById('userform_{UUID}_pwform'); link.style.display = 'none'; form.style.display = 'block'; domOpacity(form, 0, 100, 500);", 550);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   798
            <!-- BEGINNOT same_user -->document.forms['useredit_{UUID}'].changing_pw.value = 'yes';<!-- END same_user -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   799
          }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   800
          
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   801
          function userform_{UUID}_chpasswd_cancel()
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   802
          {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   803
            var link = document.getElementById('userform_{UUID}_pwlink');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   804
            var form = document.getElementById('userform_{UUID}_pwform');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   805
            domOpacity(form, 100, 0, 500);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   806
            domObjChangeOpac(0, link);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   807
            setTimeout("var link = document.getElementById('userform_{UUID}_pwlink'); var form = document.getElementById('userform_{UUID}_pwform'); form.style.display = 'none'; link.style.display = 'block'; domOpacity(link, 0, 100, 500);", 550);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   808
            <!-- BEGINNOT same_user -->document.forms['useredit_{UUID}'].changing_pw.value = 'no';<!-- END same_user -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   809
          }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   810
          
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   811
          function userform_{UUID}_validate()
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   812
          {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   813
            var form = document.forms['useredit_{UUID}'];
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   814
            <!-- BEGINNOT same_user -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   815
            if ( form.changing_pw.value == 'yes' )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   816
            {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   817
              if ( form.new_password.value != form.new_password_confirm.value )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   818
              {
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   819
                alert(\$lang.get('user_reg_err_alert_password_nomatch'));
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   820
                return false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   821
              }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   822
              form.new_password_confirm.value = '';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   823
              runEncryption();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   824
            }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   825
            <!-- END same_user -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   826
            return true;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   827
          }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   828
        </script>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   829
      
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   830
        <form action="{FORM_ACTION}" method="post" name="useredit_{UUID}" enctype="multipart/form-data" onsubmit="return userform_{UUID}_validate();">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   831
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   832
          <input name="user_id" value="{USER_ID}" type="hidden" />
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   833
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   834
          <div class="tblholder">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   835
            <table border="0" cellspacing="1" cellpadding="4">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   836
            
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   837
              <!-- Heading -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   838
            
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   839
              <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   840
                <th colspan="2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   841
                  {lang:acpum_heading_editing_user} {USERNAME}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   842
                </th>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   843
              </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   844
              
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   845
              <!-- Basic options (stored in enano_users) -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   846
              
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   847
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   848
                  <th colspan="2" class="subhead">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   849
                    {lang:acpum_heading_basic_options}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   850
                  </th>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   851
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   852
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   853
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   854
                  <td class="row2" style="width: 25%;">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   855
                    {lang:acpum_field_username}<br />
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   856
                    <small>{lang:acpum_field_username_hint}</small>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   857
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   858
                  <td class="row1" style="width: 75%;">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   859
                    <input type="text" name="username" value="{USERNAME}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   860
                    <!-- BEGIN same_user --><small>{lang:acpum_msg_same_user_username}</small><!-- END same_user -->
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   861
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   862
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   863
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   864
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   865
                  <td class="row2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   866
                    {lang:acpum_field_password}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   867
                    <!-- BEGIN password_meter -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   868
                    <br />
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   869
                    <small>{lang:acpum_field_password_hint}</small>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   870
                    <!-- END password_meter -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   871
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   872
                  <td class="row1">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   873
                    <div id="userform_{UUID}_pwlink">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   874
                      <b>{lang:acpum_msg_password_unchanged}</b> <a href="#" onclick="userform_{UUID}_chpasswd(); return false;">{lang:acpum_btn_reset_password}</a>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   875
                    </div>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   876
                    <div id="userform_{UUID}_pwform" style="display: none;">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   877
                      <!-- BEGIN same_user -->
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   878
                        {lang:acpum_msg_same_user_password} <a href="#" onclick="userform_{UUID}_chpasswd_cancel(); return false;">{lang:etc_cancel}</a>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   879
                      <!-- BEGINELSE same_user -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   880
                      <input type="hidden" name="changing_pw" value="no" />
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   881
                      <input type="hidden" name="challenge_data" value="{MD5_CHALLENGE}" />
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   882
                      <input type="hidden" name="use_crypt" value="no" />
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   883
                      <input type="hidden" name="crypt_key" value="{PUBLIC_KEY}" />
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   884
                      <input type="hidden" name="crypt_data" value="" />
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   885
                      <table border="0" style="background-color: transparent;" cellspacing="0" cellpadding="0">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   886
                        <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   887
                          <td colspan="2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   888
                            <b>{lang:acpum_field_password_title}</b>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   889
                          </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   890
                        </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   891
                        <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   892
                          <td>{lang:acpum_field_newpassword}</td>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   893
                          <!-- FIXME: localize password strength widget -->
273
96524a56d475 Minor fix for the password meter in Admin:UserManager
Dan
parents: 256
diff changeset
   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 -->
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   895
                            <!-- BEGIN password_meter -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   896
                              <div id="pwmeter" style="margin: 4px 0; height: 8px;"></div>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   897
                            <!-- END password_meter -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   898
                          </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   899
                        </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   900
                        <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   901
                          <td>{lang:acpum_field_newpassword_confirm}</td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   902
                          <td><input type="password" name="new_password_confirm" value="" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   903
                        </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   904
                        <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   905
                          <td colspan="2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   906
                            <a href="#" onclick="userform_{UUID}_chpasswd_cancel(); return false;">{lang:etc_cancel}</a>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   907
                          </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   908
                        </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   909
                      </table>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   910
                      <!-- END same_user -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   911
                    </div>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   912
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   913
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   914
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   915
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   916
                  <td class="row2" style="width: 25%;">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   917
                    {lang:acpum_field_email}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   918
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   919
                  <td class="row1" style="width: 75%;">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   920
                    <input type="text" name="email" value="{EMAIL}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   921
                    <!-- BEGIN same_user --><small>{lang:acpum_msg_same_user_email}</small><!-- END same_user -->
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   922
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   923
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   924
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   925
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   926
                  <td class="row2" style="width: 25%;">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   927
                    {lang:acpum_field_realname}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   928
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   929
                  <td class="row1" style="width: 75%;">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   930
                    <input type="text" name="real_name" value="{REAL_NAME}" size="40" <!-- BEGIN same_user -->disabled="disabled" <!-- END same_user -->/>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   931
                    <!-- BEGIN same_user --><small>{lang:acpum_msg_same_user_realname}</small><!-- END same_user -->
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   932
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   933
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   934
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   935
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   936
                  <td class="row2" style="width: 25%;">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   937
                    {lang:acpum_field_signature}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   938
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   939
                  <td class="row1" style="width: 75%;">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   940
                    {SIGNATURE_FIELD}
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   941
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   942
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   943
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   944
              <!-- / Basic options -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   945
              
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   946
              <!-- Extended options (anything in enano_users_extra) -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   947
              
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   948
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   949
                  <th class="subhead" colspan="2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   950
                    {lang:acpum_heading_imcontact}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   951
                  </th>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   952
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   953
                  <td class="row2">{lang:acpum_field_aim}</td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   954
                  <td class="row1"><input type="text" name="imaddr_aim" value="{IM_AIM}" size="30" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   955
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   956
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   957
                  <td class="row2">{lang:acpum_field_wlm}<br /><small>{lang:acpum_field_wlm_hint}</small></td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   958
                  <td class="row1"><input type="text" name="imaddr_msn" value="{IM_WLM}" size="30" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   959
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   960
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   961
                  <td class="row2">{lang:acpum_field_yim}</td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   962
                  <td class="row1"><input type="text" name="imaddr_yahoo" value="{IM_YAHOO}" size="30" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   963
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   964
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   965
                  <td class="row2">{lang:acpum_field_xmpp}</td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   966
                  <td class="row1"><input type="text" name="imaddr_xmpp" value="{IM_XMPP}" size="30" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   967
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   968
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   969
                  <th class="subhead" colspan="2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   970
                    {lang:acpum_heading_contact_extra}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   971
                  </th>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   972
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   973
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   974
                  <td class="row2">{lang:acpum_field_homepage}<br /><small>{lang:acpum_field_homepage_hint}</small></td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   975
                  <td class="row1"><input type="text" name="homepage" value="{HOMEPAGE}" size="30" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   976
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   977
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   978
                  <td class="row2">{lang:acpum_field_location}</td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   979
                  <td class="row1"><input type="text" name="location" value="{LOCATION}" size="30" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   980
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   981
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   982
                  <td class="row2">{lang:acpum_field_job}</td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   983
                  <td class="row1"><input type="text" name="occupation" value="{JOB}" size="30" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   984
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   985
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   986
                  <td class="row2">{lang:acpum_field_hobbies}</td>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   987
                  <td class="row1"><input type="text" name="hobbies" value="{HOBBIES}" size="30" /></td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   988
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   989
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
   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>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   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>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   992
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   993
              
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   994
              <!-- / Extended options -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
   995
              
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   996
              <!-- Avatar settings -->
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   997
              
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   998
                <tr>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
   999
                  <th class="subhead" colspan="2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1000
                    {lang:acpum_avatar_heading}
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1001
                  </th>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1002
                </tr>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1003
                
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1004
                <tr>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1005
                  <td class="row2">
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1006
                    {lang:usercp_avatar_label_current}
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1007
                  </td>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1008
                  <td class="row1">
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1009
                    <!-- BEGIN user_has_avatar -->
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1010
                      <img alt="{AVATAR_ALT}" src="{AVATAR_SRC}" />
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1011
                    <!-- BEGINELSE user_has_avatar -->
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1012
                      {lang:acpum_avatar_image_none}
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1013
                    <!-- END user_has_avatar -->
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1014
                  </td>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1015
                </tr>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1016
                
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1017
                <tr>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1018
                  <td class="row2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1019
                    {lang:acpum_avatar_lbl_change}
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1020
                  </td>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1021
                  <td class="row1">
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1022
                    <script type="text/javascript">
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1023
                      function admincp_users_avatar_set_{UUID}(obj)
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1024
                      {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1025
                        switch(obj.value)
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1026
                        {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1027
                          case 'keep':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1028
                          case 'remove':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1029
                            $('avatar_upload_http_{UUID}').object.style.display = 'none';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1030
                            $('avatar_upload_file_{UUID}').object.style.display = 'none';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1031
                            break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1032
                          case 'set_http':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1033
                            $('avatar_upload_http_{UUID}').object.style.display = 'block';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1034
                            $('avatar_upload_file_{UUID}').object.style.display = 'none';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1035
                            break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1036
                          case 'set_file':
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1037
                            $('avatar_upload_http_{UUID}').object.style.display = 'none';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1038
                            $('avatar_upload_file_{UUID}').object.style.display = 'block';
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1039
                            break;
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1040
                        }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1041
                      }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1042
                    </script>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  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 />
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1044
                    <label><input onclick="admincp_users_avatar_set_{UUID}(this);" type="radio" name="avatar_action" value="remove" /> {lang:acpum_avatar_lbl_remove}</label><br />
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  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 />
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1046
                      <div id="avatar_upload_http_{UUID}" style="display: none; margin: 10px 0 0 2.2em;">
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1047
                        {lang:usercp_avatar_lbl_url} <input type="text" name="avatar_http_url" size="40" value="http://" /><br />
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1048
                        <small>{lang:usercp_avatar_lbl_url_desc} {lang:usercp_avatar_limits}</small>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1049
                      </div>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  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>
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1051
                      <div id="avatar_upload_file_{UUID}" style="display: none; margin: 10px 0 0 2.2em;">
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1052
                        {lang:usercp_avatar_lbl_file} <input type="file" name="avatar_file" size="40" value="http://" /><br />
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1053
                        <small>{lang:usercp_avatar_lbl_file_desc} {lang:usercp_avatar_limits}</small>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1054
                      </div>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1055
                  </td>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1056
                </tr>
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1057
                
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1058
              <!-- / Avatar settings -->
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1059
              
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1060
              <!-- Administrator-only options -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1061
              
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1062
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1063
                  <th class="subhead" colspan="2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1064
                    {lang:acpum_heading_adminonly}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1065
                  </th>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1066
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1067
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1068
                <tr>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1069
                  <td class="row2">{lang:acpum_field_active_title}<br />
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1070
                                   <small>{lang:acpum_field_active_hint}</small>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1071
                                   </td>
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  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>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1073
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1074
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1075
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1076
                  <td class="row2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1077
                    {lang:acpum_field_userlevel}<br />
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1078
                    <small>{lang:acpum_field_userlevel_hint}</small>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1079
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1080
                  <td class="row1">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1081
                    <select name="user_level">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1082
                      <option value="{USER_LEVEL_MEMBER}"<!-- BEGIN ul_member --> selected="selected"<!-- END ul_member -->>{lang:userfuncs_ml_level_member}</option>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1083
                      <option value="{USER_LEVEL_MOD}"<!-- BEGIN ul_mod --> selected="selected"<!-- END ul_mod -->>{lang:userfuncs_ml_level_mod}</option>
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1084
                      <option value="{USER_LEVEL_ADMIN}"<!-- BEGIN ul_admin --> selected="selected"<!-- END ul_admin -->>{lang:userfuncs_ml_level_admin}</option>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1085
                    </select>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1086
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1087
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1088
                
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1089
                <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1090
                  <td class="row2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1091
                    {lang:acpum_field_deleteaccount_title}
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1092
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1093
                  <td class="row1">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  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>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1095
                    <div id="delete_blurb_{UUID}" style="display: none;">
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1096
                      <!-- BEGIN same_user -->
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1097
                      <!-- Obnoxious I know, but it's needed. -->
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1098
                      <p><b>{lang:acpum_msg_delete_own_account}</b></p>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1099
                      <!-- END same_user -->
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1100
                      <p><small>{lang:acpum_field_deleteaccount_hint}</small></p>
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1101
                    </div>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1102
                  </td>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1103
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1104
                </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1105
              
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1106
              <!-- Save button -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1107
              <tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1108
                <th colspan="2">
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1109
                  <input type="submit" name="action[save]" value="{lang:acpum_btn_save}" style="font-weight: bold;" />
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 329
diff changeset
  1110
                  <input type="submit" name="action[noop]" value="{lang:etc_cancel}" style="font-weight: normal;" />
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1111
                </th>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1112
              </tr>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1113
            
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1114
            </table>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1115
          </div>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1116
        
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1117
        </form>
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1118
        {AES_JAVASCRIPT}
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1119
      <!-- Conclusion of user edit form -->
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1120
EOF;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1121
      $parser = $template->makeParserText($tpl_code);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1122
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1123
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1124
    $this->username = htmlspecialchars($this->username);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1125
    $this->email = htmlspecialchars($this->email);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1126
    $this->user_id = intval($this->user_id);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1127
    $this->real_name = htmlspecialchars($this->real_name);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1128
    $this->signature = htmlspecialchars($this->signature);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1129
    $this->user_level = intval($this->user_level);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1130
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1131
    $im_aim   = ( isset($this->im['aim']) )   ? $this->im['aim']   : false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1132
    $im_yahoo = ( isset($this->im['yahoo']) ) ? $this->im['yahoo'] : false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1133
    $im_msn   = ( isset($this->im['msn']) )   ? $this->im['msn']   : false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1134
    $im_xmpp  = ( isset($this->im['xmpp']) )  ? $this->im['xmpp']  : false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1135
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1136
    $homepage = ( isset($this->contact['homepage']) ) ? $this->contact['homepage'] : false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1137
    $location = ( isset($this->contact['location']) ) ? $this->contact['location'] : false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1138
    $job = ( isset($this->contact['job']) ) ? $this->contact['job'] : false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1139
    $hobbies = ( isset($this->contact['hobbies']) ) ? $this->contact['hobbies'] : false;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1140
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1141
    if ( empty($this->username) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1142
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1143
      // @error One or more required parameters not set
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1144
      return 'Admin_UserManager_SmartForm::render: Invalid parameter ($form->username)';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1145
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1146
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1147
    if ( empty($this->user_id) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1148
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1149
      // @error One or more required parameters not set
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1150
      return 'Admin_UserManager_SmartForm::render: Invalid parameter ($form->user_id)';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1151
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1152
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1153
    if ( empty($this->email) )
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1154
    {
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1155
      // @error One or more required parameters not set
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1156
      return 'Admin_UserManager_SmartForm::render: Invalid parameter ($form->email)';
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1157
    }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1158
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1159
    $form_action = makeUrlNS('Special', 'Administration', 'module=' . $paths->cpage['module'], true);
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1160
    $aes_javascript = $session->aes_javascript("useredit_$this->uuid", 'new_password', 'use_crypt', 'crypt_key', 'crypt_data', 'challenge_data');
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1161
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1162
    $parser->assign_vars(array(
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1163
        'UUID' => $this->uuid,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1164
        'USERNAME' => $this->username,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1165
        'EMAIL' => $this->email,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1166
        'USER_ID' => $this->user_id,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1167
        'MD5_CHALLENGE' => $session->dss_rand(),
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1168
        'PUBLIC_KEY' => $session->rijndael_genkey(),
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1169
        'REAL_NAME' => $this->real_name,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1170
        'SIGNATURE_FIELD' => $template->tinymce_textarea('signature', $this->signature, 10, 50),
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1171
        'USER_LEVEL_MEMBER' => USER_LEVEL_CHPREF,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1172
        'USER_LEVEL_MOD' => USER_LEVEL_MOD,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1173
        'USER_LEVEL_ADMIN' => USER_LEVEL_ADMIN,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1174
        'AES_JAVASCRIPT' => $aes_javascript,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1175
        'IM_AIM' => $im_aim,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1176
        'IM_YAHOO' => $im_yahoo,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1177
        'IM_WLM' => $im_msn,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1178
        'IM_XMPP' => $im_xmpp,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1179
        'HOMEPAGE' => $homepage,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1180
        'LOCATION' => $location,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1181
        'JOB' => $job,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1182
        'HOBBIES' => $hobbies,
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1183
        'FORM_ACTION' => $form_action
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1184
      ));
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1185
    
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1186
    if ( $this->has_avatar )
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1187
    {
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1188
      $parser->assign_vars(array(
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1189
          'AVATAR_SRC' => make_avatar_url($this->user_id, $this->avi_type),
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1190
          'AVATAR_ALT' => $lang->get('usercp_avatar_image_alt', array('username' => $this->username))
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1191
        ));
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1192
    }
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1193
    
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1194
    $parser->assign_bool(array(
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1195
        'password_meter' => ( getConfig('pw_strength_enable') == '1' ),
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1196
        'ul_member' => ( $this->user_level == USER_LEVEL_CHPREF ),
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1197
        'ul_mod' => ( $this->user_level == USER_LEVEL_MOD ),
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1198
        'ul_admin' => ( $this->user_level == USER_LEVEL_ADMIN ),
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1199
        'account_active' => ( $this->account_active === true ),
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1200
        'email_public' => ( $this->email_public === true ),
329
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1201
        'same_user' => ( $this->user_id == $session->user_id ),
0437a7cf1acc Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents: 326
diff changeset
  1202
        'user_has_avatar' => ( $this->has_avatar )
140
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1203
      ));
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1204
    
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1205
    $parsed = $parser->run();
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1206
    return $parsed;
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1207
  }
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1208
  
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1209
}
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1210
40f7fa5fd061 Revamped the administrator's user CP, big time. The admin module now uses a smart form and enables all profile fields, including users_extra, to be changed. Passwords are encrypted when sent. The whole CP has been split off into a different file to accomodate the large amount of code.
Dan
parents:
diff changeset
  1211
?>