Revision 2065
Added by Dietmar almost 11 years ago
- /admin/users bugfixes user deactivating and deleting
branches/2.8.x/CHANGELOG | ||
---|---|---|
12 | 12 |
=============================================================================== |
13 | 13 |
|
14 | 14 |
|
15 |
02 Jan-2014 Build 2065 Dietmar Woellbrink (Luisehahne) |
|
16 |
# /admin/users bugfixes user deactivating and deleting |
|
15 | 17 |
01 Jan-2014 Build 2064 Manuela v.d.Decken(DarkViper) |
16 | 18 |
! register PHPMailerAutoload now in initialize instead of class.WbMailer.php |
17 | 19 |
# a unsecure require() fixed in class PHPMailer::__construct() (notice to Syncro given) |
branches/2.8.x/wb/admin/skel/themes/htt/users.htt | ||
---|---|---|
25 | 25 |
</select> |
26 | 26 |
|
27 | 27 |
<input type="submit" name="modify" style="width: 100px;" value="{TEXT_MODIFY}" class="{DISPLAY_MODIFY}" /> |
28 |
<input type="submit" name="delete" style="width: 100px;" value="{TEXT_DELETE}" onclick="return confirm('{CONFIRM_DELETE}');" class="{DISPLAY_DELETE}" /> |
|
28 |
<input type="submit" name="delete" style="width: 100px;" value="{TEXT_USER_DELETE}" onclick="return confirm('{CONFIRM_DELETE}');" class="{DISPLAY_DELETE}" />
|
|
29 | 29 |
|
30 | 30 |
<!-- BEGIN show_confirmed_activation_block --> |
31 | 31 |
<h3 class="bold">{DISPLAY_WAITING_ACTIVATION}</h3> |
32 | 32 |
<select name="activation_user_id" class="user-activation" style="width: 500px; margin-left: 34px;"> |
33 | 33 |
<!-- BEGIN list_confirmed_activation_block --> |
34 |
<option value="{VALUE}" {STATUS}>{NAME}</option>
|
|
34 |
<option value="{CVALUE}" {CSTATUS}>{CNAME}</option>
|
|
35 | 35 |
<!-- END list_confirmed_activation_block --> |
36 | 36 |
</select> |
37 | 37 |
<input type="submit" name="delete_outdated" style="width: 100px;" value="{TEXT_DELETE}" onclick="return confirm('{CONFIRM_DELETE}');" class="{DISPLAY_DELETE}" /> |
branches/2.8.x/wb/admin/interface/version.php | ||
---|---|---|
51 | 51 |
|
52 | 52 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
53 | 53 |
if(!defined('VERSION')) define('VERSION', '2.8.4'); |
54 |
if(!defined('REVISION')) define('REVISION', '2064');
|
|
54 |
if(!defined('REVISION')) define('REVISION', '2065');
|
|
55 | 55 |
if(!defined('SP')) define('SP', ''); |
branches/2.8.x/wb/admin/users/user_list.php | ||
---|---|---|
26 | 26 |
|
27 | 27 |
function show_userlist($admin, &$aActionRequest) |
28 | 28 |
{ |
29 |
global $TEXT, $MESSAGE, $HEADING, $MENU; |
|
30 | 29 |
$database = WbDatabase::getInstance(); |
30 |
$mLang = Translate::getInstance(); |
|
31 | 31 |
$iUserStatus = 1; |
32 | 32 |
$iUserStatus = ( ( $admin->get_get('status')==1 ) ? 0 : $iUserStatus ); |
33 | 33 |
unset($_GET); |
... | ... | |
54 | 54 |
$UserStatusActive = 'url('.THEME_URL.'/images/user.png)'; |
55 | 55 |
$UserStatusInactive = 'url('.THEME_URL.'/images/user_red.png)'; |
56 | 56 |
|
57 |
$sUserTitle = ($iUserStatus == 0) ? $MENU['USERS'].' '.strtolower($TEXT['ACTIVE']) : $MENU['USERS'].' '.strtolower($TEXT['DELETED']) ;
|
|
57 |
$sUserTitle = ($iUserStatus == 0) ? $mLang->MENU_USERS.' '.strtolower($mLang->TEXT_ACTIVE) : $mLang->MENU_USERS.' '.strtolower($mLang->TEXT_DELETED) ;
|
|
58 | 58 |
|
59 |
$oTpl->set_var('TEXT_USERS', $sUserTitle.' '.$TEXT['SHOW'] );
|
|
59 |
$oTpl->set_var('TEXT_USERS', $sUserTitle.' '.$mLang->TEXT_SHOW );
|
|
60 | 60 |
$oTpl->set_var('STATUS_ICON', ( ($iUserStatus==0) ? $UserStatusActive : $UserStatusInactive) ); |
61 | 61 |
|
62 | 62 |
// Get existing value from database |
63 | 63 |
$sql = 'SELECT `user_id`, `username`, `display_name`, `active` FROM `'.TABLE_PREFIX.'users` ' ; |
64 | 64 |
$sql .= 'WHERE user_id != 1 '; |
65 |
$sql .= 'AND active = '.$iUserStatus.' '; |
|
65 |
$sql .= 'AND `active` = '.$iUserStatus.' '; |
|
66 |
$sql .= 'AND `confirm_code` = \'\' '; |
|
66 | 67 |
$sql .= 'ORDER BY `display_name`,`username`'; |
67 | 68 |
|
68 | 69 |
// $query = "SELECT user_id, username, display_name, active FROM ".TABLE_PREFIX."users WHERE user_id != '1' ORDER BY display_name,username"; |
... | ... | |
71 | 72 |
$admin->print_error($database->get_error(), 'index.php'); |
72 | 73 |
} |
73 | 74 |
|
74 |
$sUserList = $TEXT['LIST_OPTIONS'].' ';
|
|
75 |
$sUserList .= ($iUserStatus == 1) ? $MENU['USERS'].' '.strtolower($TEXT['ACTIVE']) : $MENU['USERS'].' '.strtolower($TEXT['DELETED']) ;
|
|
75 |
$sUserList = $mLang->TEXT_LIST_OPTIONS.' ';
|
|
76 |
$sUserList .= ($iUserStatus == 1) ? $mLang->MENU_USERS.' '.strtolower($mLang->TEXT_ACTIVE) : $mLang->MENU_USERS.' '.strtolower($mLang->TEXT_DELETED) ;
|
|
76 | 77 |
// Insert values into the modify/remove menu |
77 | 78 |
$oTpl->set_block('main_block', 'list_block', 'list'); |
78 | 79 |
if($oRes->numRows() > 0) { |
... | ... | |
90 | 91 |
} |
91 | 92 |
} else { |
92 | 93 |
// Insert single value to say no users were found |
93 |
$oTpl->set_var('NAME', $TEXT['NONE_FOUND']);
|
|
94 |
$oTpl->set_var('NAME', $mLang->TEXT_NONE_FOUND);
|
|
94 | 95 |
$oTpl->parse('list', 'list_block', true); |
95 | 96 |
} |
96 | 97 |
|
... | ... | |
104 | 105 |
if($admin->get_permission('users_delete') != true) { |
105 | 106 |
$oTpl->set_var('DISPLAY_DELETE', 'hide'); |
106 | 107 |
} |
107 |
$HeaderTitle = $HEADING['MODIFY_DELETE_USER'].' ';
|
|
108 |
$HeaderTitle .= (($iUserStatus == 1) ? strtolower($TEXT['ACTIVE']) : strtolower($TEXT['DELETED']));
|
|
108 |
$HeaderTitle = (($iUserStatus == 1) ? $mLang->HEADING_MODIFY_ACTIVE_USER : $mLang->HEADING_MODIFY_DELETE_USER ).' ';
|
|
109 |
$HeaderTitle .= (($iUserStatus == 1) ? strtolower($mLang->TEXT_ACTIVE) : strtolower($mLang->TEXT_INACTIVE));
|
|
109 | 110 |
// Insert language headings |
110 | 111 |
$oTpl->set_var(array( |
111 | 112 |
'HEADING_MODIFY_DELETE_USER' => $HeaderTitle, |
112 |
'HEADING_ADD_USER' => $HEADING['ADD_USER']
|
|
113 |
'HEADING_ADD_USER' => $mLang->HEADING_ADD_USER
|
|
113 | 114 |
) |
114 | 115 |
); |
115 | 116 |
// insert urls |
... | ... | |
122 | 123 |
// Insert language text and messages |
123 | 124 |
$oTpl->set_var(array( |
124 | 125 |
'DISPLAY_WAITING_ACTIVATION' => '', |
125 |
'TEXT_MODIFY' => $TEXT['MODIFY'], |
|
126 |
'TEXT_DELETE' => $TEXT['DELETE'], |
|
127 |
'TEXT_MANAGE_GROUPS' => ( $admin->get_permission('groups') == true ) ? $TEXT['MANAGE_GROUPS'] : "**", |
|
128 |
'CONFIRM_DELETE' => (($iUserStatus == 1) ? $TEXT['ARE_YOU_SURE'] : $MESSAGE['USERS_CONFIRM_DELETE']) |
|
126 |
'TEXT_MODIFY' => $mLang->TEXT_MODIFY, |
|
127 |
'TEXT_DELETE' => $mLang->TEXT_DELETE, |
|
128 |
'TEXT_USER_DELETE' => (($iUserStatus == 1) ? $mLang->TEXT_DEACTIVE : $mLang->TEXT_DELETE), |
|
129 |
'TEXT_MANAGE_GROUPS' => ( $admin->get_permission('groups') == true ) ? $mLang->TEXT_MANAGE_GROUPS : "**", |
|
130 |
'CONFIRM_DELETE' => (($iUserStatus == 1) ? $mLang->TEXT_ARE_YOU_SURE : $mLang->MESSAGE_USERS_CONFIRM_DELETE) |
|
129 | 131 |
) |
130 | 132 |
); |
131 | 133 |
|
132 | 134 |
$oTpl->set_block('main_block', 'show_confirmed_activation_block', 'show_confirmed_activation'); |
133 | 135 |
if($admin->ami_group_member('1')) { |
134 | 136 |
$oTpl->set_block('show_confirmed_activation_block', 'list_confirmed_activation_block', 'list_confirmed_activation'); |
135 |
$oTpl->set_var('DISPLAY_WAITING_ACTIVATION', 'Users awaiting activation');
|
|
137 |
$oTpl->set_var('DISPLAY_WAITING_ACTIVATION', $mLang->MESSAGE_USERS_WAITING_ACTIVATION);
|
|
136 | 138 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'users` '; |
137 | 139 |
$sql .= 'WHERE `confirm_timeout` != 0 '; |
138 | 140 |
$sql .= 'AND `active` = 0 '; |
... | ... | |
144 | 146 |
// Loop through users |
145 | 147 |
if($nNumRows = $oRes->numRows()) { |
146 | 148 |
while($aUser = $oRes->fetchRow(MYSQL_ASSOC)) { |
147 |
$oTpl->set_var('VALUE',$admin->getIDKEY($aUser['user_id'])); |
|
148 |
$oTpl->set_var('STATUS', '') ; |
|
149 |
$oTpl->set_var('NAME', $aUser['display_name'].' ('.$aUser['username'].')'.' ['.$aUser['email'].']'); |
|
149 |
$oTpl->set_var('CVALUE',$admin->getIDKEY($aUser['user_id']));
|
|
150 |
$oTpl->set_var('CSTATUS', '') ;
|
|
151 |
$oTpl->set_var('CNAME', $aUser['display_name'].' ('.$aUser['username'].')'.' ['.$aUser['email'].']');
|
|
150 | 152 |
$oTpl->parse('list_confirmed_activation', 'list_confirmed_activation_block', true); |
151 | 153 |
} |
152 | 154 |
$oTpl->parse('show_confirmed_activation', 'show_confirmed_activation_block',true); |
... | ... | |
192 | 194 |
'DISPLAY_MODIFY' => '', |
193 | 195 |
'HEADING_MODIFY_USER' => '', |
194 | 196 |
'DISPLAY_HOME_FOLDERS' => '', |
195 |
'SUBMIT_TITLE' => $TEXT['ADD'],
|
|
197 |
'SUBMIT_TITLE' => $mLang->TEXT_ADD,
|
|
196 | 198 |
'HIDE_SAVE_BACK' => 'hide', |
197 | 199 |
) |
198 | 200 |
); |
... | ... | |
217 | 219 |
$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'"); |
218 | 220 |
if($results->numRows() > 0) { |
219 | 221 |
$oTpl->set_var('ID', ''); |
220 |
$oTpl->set_var('NAME', $TEXT['PLEASE_SELECT'].'...');
|
|
222 |
$oTpl->set_var('NAME', $mLang->TEXT_PLEASE_SELECT.'...');
|
|
221 | 223 |
$oTpl->set_var('SELECTED', ' selected="selected"'); |
222 | 224 |
$oTpl->parse('group_list', 'group_list_block', true); |
223 | 225 |
while($group = $results->fetchRow()) { |
... | ... | |
237 | 239 |
} else { |
238 | 240 |
if($results->numRows() == 0) { |
239 | 241 |
$oTpl->set_var('ID', ''); |
240 |
$oTpl->set_var('NAME', $TEXT['NONE_FOUND']);
|
|
242 |
$oTpl->set_var('NAME', $mLang->TEXT_NONE_FOUND);
|
|
241 | 243 |
$oTpl->parse('group_list', 'group_list_block', true); |
242 | 244 |
} |
243 | 245 |
} |
... | ... | |
278 | 280 |
|
279 | 281 |
// Insert language text and messages |
280 | 282 |
$oTpl->set_var(array( |
281 |
'TEXT_CANCEL' => $TEXT['CANCEL'],
|
|
282 |
'TEXT_RESET' => $TEXT['RESET'],
|
|
283 |
'TEXT_ACTIVE' => $TEXT['ACTIVE'],
|
|
284 |
'TEXT_DISABLED' => $TEXT['DISABLED'],
|
|
285 |
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
|
|
286 |
'TEXT_USERNAME' => $TEXT['USERNAME'],
|
|
287 |
'TEXT_PASSWORD' => $TEXT['PASSWORD'],
|
|
288 |
'TEXT_RETYPE_PASSWORD' => $TEXT['RETYPE_PASSWORD'],
|
|
289 |
'TEXT_DISPLAY_NAME' => $TEXT['DISPLAY_NAME'],
|
|
290 |
'TEXT_EMAIL' => $TEXT['EMAIL'],
|
|
291 |
'TEXT_GROUP' => $TEXT['GROUP'],
|
|
292 |
'TEXT_NONE' => $TEXT['NONE'],
|
|
293 |
'TEXT_HOME_FOLDER' => $TEXT['HOME_FOLDER'],
|
|
283 |
'TEXT_CANCEL' => $mLang->TEXT_CANCEL,
|
|
284 |
'TEXT_RESET' => $mLang->TEXT_RESET,
|
|
285 |
'TEXT_ACTIVE' => $mLang->TEXT_ACTIVE,
|
|
286 |
'TEXT_DISABLED' => $mLang->TEXT_DISABLED,
|
|
287 |
'TEXT_PLEASE_SELECT' => $mLang->TEXT_PLEASE_SELECT,
|
|
288 |
'TEXT_USERNAME' => $mLang->TEXT_USERNAME,
|
|
289 |
'TEXT_PASSWORD' => $mLang->TEXT_PASSWORD,
|
|
290 |
'TEXT_RETYPE_PASSWORD' => $mLang->TEXT_RETYPE_PASSWORD,
|
|
291 |
'TEXT_DISPLAY_NAME' => $mLang->TEXT_DISPLAY_NAME,
|
|
292 |
'TEXT_EMAIL' => $mLang->TEXT_EMAIL,
|
|
293 |
'TEXT_GROUP' => $mLang->TEXT_GROUP,
|
|
294 |
'TEXT_NONE' => $mLang->TEXT_NONE,
|
|
295 |
'TEXT_HOME_FOLDER' => $mLang->TEXT_HOME_FOLDER,
|
|
294 | 296 |
'USERNAME_FIELDNAME' => $username_fieldname, |
295 |
'CHANGING_PASSWORD' => $MESSAGE['USERS_CHANGING_PASSWORD']
|
|
297 |
'CHANGING_PASSWORD' => $mLang->MESSAGE_USERS_CHANGING_PASSWORD
|
|
296 | 298 |
) |
297 | 299 |
); |
298 | 300 |
|
branches/2.8.x/wb/admin/users/save.php | ||
---|---|---|
25 | 25 |
|
26 | 26 |
function save_user($admin, &$aActionRequest) |
27 | 27 |
{ |
28 |
global $TEXT, $MESSAGE; |
|
29 | 28 |
// Create a javascript back link |
30 | 29 |
// $js_back = ADMIN_URL.'/users/index.php'; |
31 | 30 |
unset($aActionRequest['save']); |
32 | 31 |
|
33 | 32 |
$aActionRequest['modify']= 'change'; |
34 | 33 |
$database = WbDatabase::getInstance(); |
34 |
$mLang = Translate::getInstance(); |
|
35 | 35 |
$bRetVal = 0; |
36 | 36 |
$iMinPassLength = 6; |
37 | 37 |
|
38 | 38 |
if( !$admin->checkFTAN() ) |
39 | 39 |
{ |
40 |
msgQueue::add($MESSAGE['GENERIC_SECURITY_ACCESS']);
|
|
40 |
msgQueue::add($mLang->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
41 | 41 |
return $bRetVal; |
42 | 42 |
} |
43 | 43 |
|
44 | 44 |
// Check if user id is a valid number and doesnt equal 1 |
45 | 45 |
if(!isset($aActionRequest['user_id']) OR !is_numeric($aActionRequest['user_id']) OR $aActionRequest['user_id'] == 1) { |
46 |
msgQueue::add('::'.$MESSAGE['GENERIC_NOT_UPGRADED']);
|
|
46 |
msgQueue::add('::'.$mLang->MESSAGE_GENERIC_NOT_UPGRADED);
|
|
47 | 47 |
return $bRetVal; |
48 | 48 |
} else { |
49 | 49 |
$user_id = intval($aActionRequest['user_id']); |
... | ... | |
52 | 52 |
if( ($user_id < 2 ) ) |
53 | 53 |
{ |
54 | 54 |
// if($admin_header) { $admin->print_header(); } |
55 |
msgQueue::add($MESSAGE['GENERIC_SECURITY_OFFENSE']);
|
|
55 |
msgQueue::add($mLang->MESSAGE_GENERIC_SECURITY_OFFENSE);
|
|
56 | 56 |
return $bRetVal; |
57 | 57 |
} |
58 | 58 |
// Get existing values |
... | ... | |
83 | 83 |
|
84 | 84 |
// Check values |
85 | 85 |
if($groups_id == "") { |
86 |
msgQueue::add($MESSAGE['USERS_NO_GROUP']);
|
|
86 |
msgQueue::add($mLang->MESSAGE_USERS_NO_GROUP);
|
|
87 | 87 |
} else { |
88 | 88 |
$aGroups_id = explode(',', $groups_id); |
89 | 89 |
//if user is in administrator-group, get this group else just get the first one |
... | ... | |
93 | 93 |
//$admin->is_group_match($admin->get_groups_id(), '1' ) |
94 | 94 |
if(!preg_match('/^[a-z]{1}[a-z0-9_-]{2,}$/i', $username)) |
95 | 95 |
{ |
96 |
msgQueue::add( $MESSAGE['USERS_NAME_INVALID_CHARS']);
|
|
96 |
msgQueue::add( $mLang->MESSAGE_USERS_NAME_INVALID_CHARS);
|
|
97 | 97 |
} |
98 | 98 |
|
99 | 99 |
if($password != "") { |
100 | 100 |
if(strlen($password) < $iMinPassLength ) { |
101 |
msgQueue::add($MESSAGE['USERS_PASSWORD_TOO_SHORT']); |
|
101 |
msgQueue::add($mLang->MESSAGE['USERS_PASSWORD_TOO_SHORT']);
|
|
102 | 102 |
} |
103 | 103 |
|
104 | 104 |
$pattern = '/[^'.$admin->password_chars.']/'; |
105 | 105 |
if (preg_match($pattern, $password)) { |
106 |
msgQueue::add($MESSAGE['PREFERENCES_INVALID_CHARS']);
|
|
106 |
msgQueue::add($mLang->MESSAGE_PREFERENCES_INVALID_CHARS);
|
|
107 | 107 |
} |
108 | 108 |
|
109 | 109 |
if(($password != $password2) ) { |
110 |
msgQueue::add($MESSAGE['USERS_PASSWORD_MISMATCH']);
|
|
110 |
msgQueue::add($mLang->MESSAGE_USERS_PASSWORD_MISMATCH);
|
|
111 | 111 |
} |
112 | 112 |
} |
113 | 113 |
// check that display_name is unique in whoole system (prevents from User-faking) |
114 | 114 |
$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'users` '; |
115 | 115 |
$sql .= 'WHERE `user_id` <> '.(int)$user_id.' AND `display_name` LIKE "'.$display_name.'"'; |
116 | 116 |
if( $database->get_one($sql) > 0 ){ |
117 |
msgQueue::add($MESSAGE['USERS_USERNAME_TAKEN'].' ('.$TEXT['DISPLAY_NAME'].')');
|
|
118 |
msgQueue::add($MESSAGE['MEDIA_CANNOT_RENAME']);
|
|
117 |
msgQueue::add($mLang->MESSAGE_USERS_USERNAME_TAKEN.' ('.$mLang->TEXT_DISPLAY_NAME.')');
|
|
118 |
msgQueue::add($mLang->MESSAGE_MEDIA_CANNOT_RENAME);
|
|
119 | 119 |
} |
120 | 120 |
// |
121 | 121 |
if( ($admin->get_user_id() != '1' ) ) |
122 | 122 |
{ |
123 | 123 |
if(findStringInFileList($display_name, dirname(__FILE__).'/disallowedNames')) { |
124 |
msgQueue::add( $TEXT['ERROR'].' '.$TEXT['DISPLAY_NAME'].' ('.$display_name.')' );
|
|
124 |
msgQueue::add( $mLang->TEXT_ERROR.' '.$mLang->TEXT_DISPLAY_NAME.' ('.$display_name.')' );
|
|
125 | 125 |
} |
126 | 126 |
} |
127 | 127 |
|
... | ... | |
131 | 131 |
{ |
132 | 132 |
if($admin->validate_email($email) == false) |
133 | 133 |
{ |
134 |
msgQueue::add($MESSAGE['USERS_INVALID_EMAIL'].' ('.$email.')');
|
|
134 |
msgQueue::add($mLang->MESSAGE_USERS_INVALID_EMAIL.' ('.$email.')');
|
|
135 | 135 |
} |
136 | 136 |
} else { // e-mail must be present |
137 |
msgQueue::add($MESSAGE['SIGNUP_NO_EMAIL']);
|
|
137 |
msgQueue::add($mLang->MESSAGE_SIGNUP_NO_EMAIL);
|
|
138 | 138 |
} |
139 | 139 |
|
140 | 140 |
$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'users` '. |
... | ... | |
143 | 143 |
// Check if the email already exists |
144 | 144 |
if( ($iFoundUser = $database->get_one($sql)) != null ) { |
145 | 145 |
if($iFoundUser) { |
146 |
if(isset($MESSAGE['USERS_EMAIL_TAKEN']))
|
|
146 |
if(isset($mLang->MESSAGE_USERS_EMAIL_TAKEN))
|
|
147 | 147 |
{ |
148 |
msgQueue::add($MESSAGE['USERS_EMAIL_TAKEN'].' ('.$email.')');
|
|
148 |
msgQueue::add($mLang->MESSAGE_USERS_EMAIL_TAKEN.' ('.$email.')');
|
|
149 | 149 |
} else { |
150 |
msgQueue::add($MESSAGE['USERS_INVALID_EMAIL'].' ('.$email.')');
|
|
150 |
msgQueue::add($mLang->MESSAGE_USERS_INVALID_EMAIL.' ('.$email.')');
|
|
151 | 151 |
} |
152 | 152 |
} |
153 | 153 |
} |
... | ... | |
174 | 174 |
$sHomeFolder = WB_PATH.MEDIA_DIRECTORY.'/home/'.( media_filename($username) ); |
175 | 175 |
if ( sizeof(createFolderProtectFile( $sHomeFolder )) ) |
176 | 176 |
{ |
177 |
// msgQueue::add($MESSAGE['MEDIA_DIR_NOT_MADE']);
|
|
177 |
// msgQueue::add($mLang->MESSAGE_MEDIA_DIR_NOT_MADE);
|
|
178 | 178 |
} |
179 | 179 |
} |
180 | 180 |
|
... | ... | |
204 | 204 |
|
205 | 205 |
} |
206 | 206 |
if($database->query($sql)) { |
207 |
msgQueue::add($MESSAGE['USERS_SAVED'], true);
|
|
207 |
msgQueue::add($mLang->MESSAGE_USERS_SAVED, true);
|
|
208 | 208 |
$bRetVal = $user_id; |
209 | 209 |
} |
210 | 210 |
if($database->is_error()) { |
211 | 211 |
msgQueue::add( implode('<br />',explode(';',$database->get_error())) ); |
212 | 212 |
} |
213 | 213 |
} else { |
214 |
msgQueue::add($MESSAGE['GENERIC_NOT_UPGRADED']);
|
|
214 |
msgQueue::add($mLang->MESSAGE_GENERIC_NOT_UPGRADED);
|
|
215 | 215 |
} |
216 | 216 |
|
217 | 217 |
// return $admin->getIDKEY($user_id); |
branches/2.8.x/wb/admin/users/languages/EN.php | ||
---|---|---|
1 |
<?php |
|
2 |
/**************************************************************************************** |
|
3 |
* extended language definition for WebsiteBaker * |
|
4 |
* ACP-module users * |
|
5 |
* english (GB) * |
|
6 |
****************************************************************************************/ |
|
7 |
|
|
8 |
$HEADING['ADD_USER'] = 'Add User'; |
|
9 |
$HEADING['MODIFY_USER'] = 'Change User'; |
|
10 |
$HEADING['MODIFY_ACTIVE_USER'] = 'Changing/disabling users'; // new |
|
11 |
$HEADING['MODIFY_DELETE_USER'] = 'Changing/deleting users'; |
|
12 |
|
|
13 |
$MENU['USERS'] = 'Users'; |
|
14 |
|
|
15 |
$MESSAGE['GENERIC_FILL_IN_ALL'] = 'Please fill in all fields'; |
|
16 |
$MESSAGE['GENERIC_FORGOT_OPTIONS'] = 'You have not made a selection!'; |
|
17 |
$MESSAGE['GENERIC_NOT_COMPARE'] = ' not possible'; |
|
18 |
$MESSAGE['GENERIC_NOT_UPGRADED'] = 'Can not Update'; |
|
19 |
$MESSAGE['GENERIC_SECURITY_ACCESS'] = 'Security breach! Access is denied!'; |
|
20 |
$MESSAGE['MEDIA_DIR_MADE'] = 'The directory was created successfully'; |
|
21 |
$MESSAGE['MEDIA_DIR_NOT_MADE'] = 'The directory could not be created'; |
|
22 |
$MESSAGE['MEDIA_CANNOT_RENAME'] = 'The rename was not successful'; |
|
23 |
$MESSAGE['MEDIA_RENAMED'] = 'The renaming was successful'; |
|
24 |
$MESSAGE['PREFERENCES_INVALID_CHARS'] = 'Invalid characters were used for the password'; |
|
25 |
$MESSAGE['PREFERENCES_PASSWORD_CHANGED'] = 'The password has been changed successfully'; |
|
26 |
$MESSAGE['SIGNUP_NO_EMAIL'] = 'Please enter an email address'; |
|
27 |
$MESSAGE['USERS_ADDED'] = 'The user was successfully added'; |
|
28 |
$MESSAGE['USERS_CHANGING_PASSWORD'] = 'Please note: You should only enter values in the fields above, if you want to change the password of this user'; |
|
29 |
$MESSAGE['USERS_CONFIRM_DELETE'] = 'Are you sure you want to delete the selected user?'; |
|
30 |
$MESSAGE['USERS_DELETED'] = 'The user was successfully deleted'; |
|
31 |
$MESSAGE['USERS_EMAIL_TAKEN'] = 'The given e-mail address is already in use'; |
|
32 |
$MESSAGE['USERS_INVALID_EMAIL'] = 'The e-mail address is invalid'; |
|
33 |
$MESSAGE['USERS_NAME_INVALID_CHARS'] = 'Invalid characters were used for login names'; |
|
34 |
$MESSAGE['USERS_NO_GROUP'] = 'There was no group selected'; |
|
35 |
$MESSAGE['USERS_PASSWORD_MISMATCH'] = 'The specified password is invalid'; |
|
36 |
$MESSAGE['USERS_PASSWORD_TOO_SHORT'] = 'The password you entered was too short'; |
|
37 |
$MESSAGE['USERS_SAVED'] = 'The user has been successfully saved'; |
|
38 |
$MESSAGE['USERS_USERNAME_TAKEN'] = 'The specified login name is already in use'; |
|
39 |
$MESSAGE['USERS_USERNAME_TOO_SHORT'] = 'The entered login name was too short'; |
|
40 |
$MESSAGE['USERS_WAITING_ACTIVATION'] = 'Awaiting user activation'; // new |
|
41 |
|
|
42 |
$TEXT['ACTIVE'] = 'Activ'; |
|
43 |
$TEXT['DEACTIVE'] = 'Deactivate'; // new |
|
44 |
$TEXT['DEACTIVED'] = 'Disabled'; // new |
|
45 |
$TEXT['ADD'] = 'Add'; |
|
46 |
$TEXT['ARE_YOU_SURE'] = 'Are you sure?'; |
|
47 |
$TEXT['BACK'] = 'Back'; |
|
48 |
$TEXT['CANCEL'] = 'Cancel'; |
|
49 |
$TEXT['CAN_DELETE_HIMSELF'] = 'Can delete itself'; |
|
50 |
$TEXT['CHANGE'] = 'Changing'; |
|
51 |
$TEXT['CHANGES'] = 'Changes'; |
|
52 |
$TEXT['DELETE'] = 'Remove'; |
|
53 |
$TEXT['DELETED'] = 'Deleted'; |
|
54 |
$TEXT['DISABLED'] = 'Disabled'; |
|
55 |
$TEXT['DISPLAY_NAME'] = 'Display Name'; |
|
56 |
$TEXT['EMAIL'] = 'E-Mail'; |
|
57 |
$TEXT['EMAIL_ADDRESS'] = 'E-Mail Adress'; |
|
58 |
$TEXT['ENABLED'] = 'Enabled'; |
|
59 |
$TEXT['ERROR'] = 'Error'; |
|
60 |
$TEXT['FULL_NAME'] = 'Full Name'; |
|
61 |
$TEXT['GROUP'] = 'Group'; |
|
62 |
$TEXT['HOME_FOLDER'] = 'Personal Folder'; |
|
63 |
$TEXT['HOME_FOLDERS'] = 'Personal Folders'; |
|
64 |
$TEXT['INACTIVE'] = 'Inactiv'; // new |
|
65 |
$TEXT['LIST_OPTIONS'] = 'Shortlist'; |
|
66 |
$TEXT['MANAGE_GROUPS'] = 'Manage Groups'; |
|
67 |
$TEXT['MODIFY'] = 'Changing'; |
|
68 |
$TEXT['NONE'] = 'None'; |
|
69 |
$TEXT['NONE_FOUND'] = 'Not found'; |
|
70 |
$TEXT['NO_RESULTS'] = 'No results'; |
|
71 |
$TEXT['NO_SELECTION'] = 'No selection'; |
|
72 |
$TEXT['PASSWORD'] = 'Password'; |
|
73 |
$TEXT['PLEASE_SELECT'] = 'Please select'; |
|
74 |
$TEXT['RESET'] = 'Reset'; |
|
75 |
$TEXT['RETYPE_NEW_PASSWORD'] = 'Repeat new password'; |
|
76 |
$TEXT['RETYPE_PASSWORD'] = 'Repeat Password'; |
|
77 |
$TEXT['SAVE'] = 'Save'; |
|
78 |
$TEXT['SHOW'] = 'Show'; |
|
79 |
$TEXT['USER'] = 'User'; |
|
80 |
$TEXT['USERNAME'] = 'Loginname'; |
|
81 |
$TEXT['USERS_ACTIVE'] = 'User is active'; |
|
82 |
$TEXT['USERS_CAN_SELFDELETE'] = 'Self-deleting possible'; |
|
83 |
$TEXT['USERS_CHANGE_SETTINGS'] = 'Users can change their own settings'; |
|
84 |
$TEXT['USERS_DELETED'] = 'The user was successfully deleted'; |
|
85 |
$TEXT['USERS_MARKED_DELETED'] = 'User is marked as deleted'; // new |
branches/2.8.x/wb/admin/users/languages/DE.php | ||
---|---|---|
1 |
<?php |
|
2 |
/**************************************************************************************** |
|
3 |
* extended language definition for WebsiteBaker * |
|
4 |
* ACP-module users * |
|
5 |
* deutsch * |
|
6 |
****************************************************************************************/ |
|
7 |
|
|
8 |
$HEADING['ADD_USER'] = 'Benutzer hinzufügen'; |
|
9 |
$HEADING['MODIFY_USER'] = 'Benutzer ändern'; |
|
10 |
$HEADING['MODIFY_ACTIVE_USER'] = 'Ändern/Deaktivieren von Benutzern'; // new |
|
11 |
$HEADING['MODIFY_DELETE_USER'] = 'Ändern/Löschen von Benutzern'; |
|
12 |
|
|
13 |
$MENU['USERS'] = 'Benutzer'; |
|
14 |
|
|
15 |
$MESSAGE['GENERIC_FILL_IN_ALL'] = 'Bitte alle Felder ausfüllen'; |
|
16 |
$MESSAGE['GENERIC_FORGOT_OPTIONS'] = 'Sie haben keine Auswahl getroffen!'; |
|
17 |
$MESSAGE['GENERIC_NOT_COMPARE'] = ' nicht möglich'; |
|
18 |
$MESSAGE['GENERIC_NOT_UPGRADED'] = 'Aktualisierung nicht möglich'; |
|
19 |
$MESSAGE['GENERIC_SECURITY_ACCESS'] = 'Sicherheitsverletzung!! Zugriff wurde verweigert!'; |
|
20 |
$MESSAGE['MEDIA_DIR_MADE'] = 'Das Verzeichnis wurde erfolgreich angelegt'; |
|
21 |
$MESSAGE['MEDIA_DIR_NOT_MADE'] = 'Das Verzeichnis konnte nicht angelegt werden'; |
|
22 |
$MESSAGE['MEDIA_CANNOT_RENAME'] = 'Das Umbenennen war nicht erfolgreich'; |
|
23 |
$MESSAGE['MEDIA_RENAMED'] = 'Das Umbenennen war erfolgreich'; |
|
24 |
$MESSAGE['PREFERENCES_INVALID_CHARS'] = 'Es wurden ungültige Zeichen für des Passwort verwendet'; |
|
25 |
$MESSAGE['PREFERENCES_PASSWORD_CHANGED'] = 'Das Passwort wurde erfolgreich geändert'; |
|
26 |
$MESSAGE['SIGNUP_NO_EMAIL'] = 'Bitte geben Sie eine E-Mail Adresse an'; |
|
27 |
$MESSAGE['USERS_ADDED'] = 'Der Benutzer wurde erfolgreich hinzugefügt'; |
|
28 |
$MESSAGE['USERS_CHANGING_PASSWORD'] = 'Bitte beachten Sie: Sie sollten in die obigen Felder nur Werte eingeben, wenn Sie das Passwort dieses Benutzers ändern möchten'; |
|
29 |
$MESSAGE['USERS_CONFIRM_DELETE'] = 'Sind Sie sicher, dass Sie den ausgewählten Benutzer löschen möchten?'; |
|
30 |
$MESSAGE['USERS_DELETED'] = 'Der Benutzer wurde erfolgreich gelöscht'; |
|
31 |
$MESSAGE['USERS_EMAIL_TAKEN'] = 'Die angegebene E-Mail Adresse wird bereits verwendet'; |
|
32 |
$MESSAGE['USERS_INVALID_EMAIL'] = 'Die angegebene E-Mail Adresse ist ungültig'; |
|
33 |
$MESSAGE['USERS_NAME_INVALID_CHARS'] = 'Es wurden ungültige Zeichen für den Loginnamen verwendet'; |
|
34 |
$MESSAGE['USERS_NO_GROUP'] = 'Es wurde keine Gruppe ausgewählt'; |
|
35 |
$MESSAGE['USERS_PASSWORD_MISMATCH'] = 'Das angegebene Passwort ist ungültig'; |
|
36 |
$MESSAGE['USERS_PASSWORD_TOO_SHORT'] = 'Das eingegebene Passwort war zu kurz'; |
|
37 |
$MESSAGE['USERS_SAVED'] = 'Der Benutzer wurde erfolgreich gespeichert'; |
|
38 |
$MESSAGE['USERS_USERNAME_TAKEN'] = 'Der angegebene Loginname wird bereits verwendet'; |
|
39 |
$MESSAGE['USERS_USERNAME_TOO_SHORT'] = 'Der eingegebene Loginname war zu kurz'; |
|
40 |
$MESSAGE['USERS_WAITING_ACTIVATION'] = 'Erwarte Benutzer Aktivierung'; // new |
|
41 |
|
|
42 |
$TEXT['ACTIVE'] = 'Aktiv'; |
|
43 |
$TEXT['DEACTIVE'] = 'Deaktivieren'; // new |
|
44 |
$TEXT['DEACTIVED'] = 'Deaktiviert'; // new |
|
45 |
$TEXT['ADD'] = 'Hinzufügen'; |
|
46 |
$TEXT['ARE_YOU_SURE'] = 'Sind Sie sicher?'; |
|
47 |
$TEXT['BACK'] = 'Zurück'; |
|
48 |
$TEXT['CANCEL'] = 'Abbrechen'; |
|
49 |
$TEXT['CAN_DELETE_HIMSELF'] = 'Kann sich selber löschen'; |
|
50 |
$TEXT['CHANGE'] = 'Ändern'; |
|
51 |
$TEXT['CHANGES'] = 'Änderungen'; |
|
52 |
$TEXT['DELETE'] = 'Entfernen'; |
|
53 |
$TEXT['DELETED'] = 'Gelöscht'; |
|
54 |
$TEXT['DISABLED'] = 'Ausgeschaltet'; |
|
55 |
$TEXT['DISPLAY_NAME'] = 'Angezeigter Name'; |
|
56 |
$TEXT['EMAIL'] = 'E-Mail'; |
|
57 |
$TEXT['EMAIL_ADDRESS'] = 'E-Mail Adresse'; |
|
58 |
$TEXT['ENABLED'] = 'Eingeschaltet'; |
|
59 |
$TEXT['ERROR'] = 'Fehler'; |
|
60 |
$TEXT['FULL_NAME'] = 'Voller Name'; |
|
61 |
$TEXT['GROUP'] = 'Gruppe'; |
|
62 |
$TEXT['HOME_FOLDER'] = 'Persönlicher Ordner'; |
|
63 |
$TEXT['HOME_FOLDERS'] = 'Persönliche Ordner'; |
|
64 |
$TEXT['INACTIVE'] = 'Inaktiv'; // new |
|
65 |
$TEXT['LIST_OPTIONS'] = 'Auswahlliste'; |
|
66 |
$TEXT['MANAGE_GROUPS'] = 'Gruppen verwalten'; |
|
67 |
$TEXT['MODIFY'] = 'Ändern'; |
|
68 |
$TEXT['NONE'] = 'Keine'; |
|
69 |
$TEXT['NONE_FOUND'] = 'Keine gefunden'; |
|
70 |
$TEXT['NO_RESULTS'] = 'Keine Ergebnisse'; |
|
71 |
$TEXT['NO_SELECTION'] = 'Keine Auswahl'; |
|
72 |
$TEXT['PASSWORD'] = 'Passwort'; |
|
73 |
$TEXT['PLEASE_SELECT'] = 'Bitte auswählen'; |
|
74 |
$TEXT['RESET'] = 'Zurücksetzen'; |
|
75 |
$TEXT['RETYPE_NEW_PASSWORD'] = 'Neues Passwort wiederholen'; |
|
76 |
$TEXT['RETYPE_PASSWORD'] = 'Passwort wiederholen'; |
|
77 |
$TEXT['SAVE'] = 'Speichern'; |
|
78 |
$TEXT['SHOW'] = 'zeigen'; |
|
79 |
$TEXT['USER'] = 'Benutzer'; |
|
80 |
$TEXT['USERNAME'] = 'Loginname'; |
|
81 |
$TEXT['USERS_ACTIVE'] = 'Benutzer ist aktiv'; |
|
82 |
$TEXT['USERS_CAN_SELFDELETE'] = 'Selbstlöschung möglich'; |
|
83 |
$TEXT['USERS_CHANGE_SETTINGS'] = 'Benutzer kann eigene Einstellungen ändern'; |
|
84 |
$TEXT['USERS_DELETED'] = 'Der Benutzer wurde erfolgreich gelöscht'; |
|
85 |
$TEXT['USERS_MARKED_DELETED'] = 'Benutzer ist als gelöscht markiert'; // new |
branches/2.8.x/wb/admin/users/user_form.php | ||
---|---|---|
26 | 26 |
|
27 | 27 |
function show_usermask($admin, &$aActionRequest) |
28 | 28 |
{ |
29 |
global $TEXT, $MESSAGE, $HEADING, $MENU; |
|
30 | 29 |
$database = WbDatabase::getInstance(); |
30 |
$mLang = Translate::getInstance(); |
|
31 | 31 |
|
32 | 32 |
$user_id = intval($aActionRequest['user_id']); |
33 | 33 |
$user = array( |
... | ... | |
71 | 71 |
'SUB_ACTION' => 'save', |
72 | 72 |
'BACK_LINK' => (isset($aActionRequest['BackLink'])) ? $aActionRequest['BackLink'] : '', |
73 | 73 |
'CANCEL_URL' => $aActionRequest['cancel_url'], |
74 |
'SUBMIT_TITLE' => $TEXT['SAVE'],
|
|
74 |
'SUBMIT_TITLE' => $mLang->TEXT_SAVE,
|
|
75 | 75 |
'USER_ID' => $user['user_id'], |
76 | 76 |
// 'NO_RIGHTS' => 'hide', |
77 | 77 |
// 'CHANGING_GROUPS' => '', |
... | ... | |
101 | 101 |
$sql .= 'WHERE `group_id` != 1 ORDER BY `name`'; |
102 | 102 |
if($oRes = $database->query($sql)) { |
103 | 103 |
$oTpl->set_var('ID', ''); |
104 |
$oTpl->set_var('NAME', $TEXT['PLEASE_SELECT'].'...');
|
|
104 |
$oTpl->set_var('NAME', $mLang->TEXT_PLEASE_SELECT.'...');
|
|
105 | 105 |
$oTpl->set_var('SELECTED', ''); |
106 | 106 |
$oTpl->parse('group_list', 'group_list_block', true); |
107 | 107 |
while($group = $oRes->fetchRow(MYSQL_ASSOC)) { |
... | ... | |
147 | 147 |
} else { |
148 | 148 |
if($oRes->numRows() == 0) { |
149 | 149 |
$oTpl->set_var('ID', ''); |
150 |
$oTpl->set_var('NAME', $TEXT['NONE_FOUND']);
|
|
150 |
$oTpl->set_var('NAME', $mLang->TEXT_NONE_FOUND);
|
|
151 | 151 |
$oTpl->set_var('SELECTED', ' selected="selected"'); |
152 | 152 |
$oTpl->parse('group_list', 'group_list_block', true); |
153 | 153 |
} |
... | ... | |
189 | 189 |
|
190 | 190 |
// Insert language text and messages |
191 | 191 |
$oTpl->set_var(array( |
192 |
'TEXT_RESET' => $TEXT['RESET'],
|
|
193 |
'TEXT_CANCEL' => $TEXT['CANCEL'],
|
|
194 |
'TEXT_ACTIVE' => $TEXT['ACTIVE'],
|
|
195 |
'TEXT_DISABLED' => $TEXT['DISABLED'],
|
|
196 |
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
|
|
197 |
'TEXT_USERNAME' => $TEXT['USERNAME'],
|
|
198 |
'TEXT_PASSWORD' => $TEXT['PASSWORD'],
|
|
199 |
'TEXT_RETYPE_PASSWORD' => $TEXT['RETYPE_PASSWORD'],
|
|
200 |
'TEXT_DISPLAY_NAME' => $TEXT['DISPLAY_NAME'],
|
|
201 |
'TEXT_EMAIL' => $TEXT['EMAIL'],
|
|
202 |
'TEXT_GROUP' => $TEXT['GROUP'],
|
|
203 |
'TEXT_NONE' => $TEXT['NONE'],
|
|
204 |
'TEXT_HOME_FOLDER' => $TEXT['HOME_FOLDER'],
|
|
205 |
'TEXT_SAVE_BACK' => $TEXT['SAVE'].' & '.$TEXT['BACK'],
|
|
192 |
'TEXT_RESET' => $mLang->TEXT_RESET,
|
|
193 |
'TEXT_CANCEL' => $mLang->TEXT_CANCEL,
|
|
194 |
'TEXT_ACTIVE' => $mLang->TEXT_ACTIVE,
|
|
195 |
'TEXT_DISABLED' => $mLang->TEXT_DISABLED,
|
|
196 |
'TEXT_PLEASE_SELECT' => $mLang->TEXT_PLEASE_SELECT,
|
|
197 |
'TEXT_USERNAME' => $mLang->TEXT_USERNAME,
|
|
198 |
'TEXT_PASSWORD' => $mLang->TEXT_PASSWORD,
|
|
199 |
'TEXT_RETYPE_PASSWORD' => $mLang->TEXT_RETYPE_PASSWORD,
|
|
200 |
'TEXT_DISPLAY_NAME' => $mLang->TEXT_DISPLAY_NAME,
|
|
201 |
'TEXT_EMAIL' => $mLang->TEXT_EMAIL,
|
|
202 |
'TEXT_GROUP' => $mLang->TEXT_GROUP,
|
|
203 |
'TEXT_NONE' => $mLang->TEXT_NONE,
|
|
204 |
'TEXT_HOME_FOLDER' => $mLang->TEXT_HOME_FOLDER,
|
|
205 |
'TEXT_SAVE_BACK' => $mLang->TEXT_SAVE.' & '.$mLang->TEXT_BACK,
|
|
206 | 206 |
'USERNAME_FIELDNAME' => $username_fieldname, |
207 |
'CHANGING_PASSWORD' => $MESSAGE['USERS_CHANGING_PASSWORD'],
|
|
208 |
'HEADING_MODIFY_USER' => $HEADING['MODIFY_USER']
|
|
207 |
'CHANGING_PASSWORD' => $mLang->MESSAGE_USERS_CHANGING_PASSWORD,
|
|
208 |
'HEADING_MODIFY_USER' => $mLang->HEADING_MODIFY_USER
|
|
209 | 209 |
) |
210 | 210 |
); |
211 | 211 |
|
branches/2.8.x/wb/admin/users/delete.php | ||
---|---|---|
25 | 25 |
/* -------------------------------------------------------- */ |
26 | 26 |
function delete_user($admin, &$aActionRequest) |
27 | 27 |
{ |
28 |
global $TEXT, $MESSAGE; |
|
29 | 28 |
$database = WbDatabase::getInstance(); |
29 |
$mLang = Translate::getInstance(); |
|
30 | 30 |
$aUserID = array(); |
31 | 31 |
$bRetVal = false; |
32 |
if(isset($aActionRequest['activation_user_id'])) { |
|
33 |
if(!is_array($aActionRequest['activation_user_id'])) { |
|
34 |
|
|
35 |
$aUserID[] = $aActionRequest['activation_user_id']; |
|
36 |
} else { |
|
37 |
$aUserID = $aActionRequest['activation_user_id']; |
|
38 |
} |
|
39 |
} else { |
|
40 |
if(isset($aActionRequest['user_id'])) { |
|
41 |
if(!is_array($aActionRequest['user_id'])) { |
|
42 |
|
|
43 |
$aUserID[] = $aActionRequest['user_id']; |
|
44 |
} else { |
|
45 |
$aUserID = $aActionRequest['user_id']; |
|
46 |
} |
|
47 |
} |
|
48 |
} |
|
49 | 32 |
|
33 |
$action = 'default'; |
|
34 |
$action = (isset($aActionRequest['delete']) ? 'delete' : $action ); |
|
35 |
$action = (isset($aActionRequest['delete_outdated']) ? 'delete_outdated' : $action ); |
|
36 |
|
|
37 |
switch($action) : |
|
38 |
case 'delete': // delete the user |
|
39 |
if(isset($aActionRequest['user_id'])) { |
|
40 |
if(!is_array($aActionRequest['user_id'])) { |
|
41 |
$aUserID[] = $aActionRequest['user_id']; |
|
42 |
} else { |
|
43 |
$aUserID = $aActionRequest['user_id']; |
|
44 |
} |
|
45 |
} |
|
46 |
break; |
|
47 |
case 'delete_outdated': // delete Users awaiting activation |
|
48 |
if(isset($aActionRequest['activation_user_id'])) { |
|
49 |
if(!is_array($aActionRequest['activation_user_id'])) { |
|
50 |
$aUserID[] = $aActionRequest['activation_user_id']; |
|
51 |
} else { |
|
52 |
$aUserID = $aActionRequest['activation_user_id']; |
|
53 |
} |
|
54 |
} |
|
55 |
break; |
|
56 |
default: // show userlist with empty modify mask |
|
57 |
endswitch; // end of switch |
|
58 |
|
|
59 |
// if(isset($aActionRequest['activation_user_id'])) { |
|
60 |
// if(!is_array($aActionRequest['activation_user_id'])) { |
|
61 |
// |
|
62 |
// $aUserID[] = $aActionRequest['activation_user_id']; |
|
63 |
// } else { |
|
64 |
// $aUserID = $aActionRequest['activation_user_id']; |
|
65 |
// } |
|
66 |
// } else { |
|
67 |
// if(isset($aActionRequest['user_id'])) { |
|
68 |
// if(!is_array($aActionRequest['user_id'])) { |
|
69 |
// |
|
70 |
// $aUserID[] = $aActionRequest['user_id']; |
|
71 |
// } else { |
|
72 |
// $aUserID = $aActionRequest['user_id']; |
|
73 |
// } |
|
74 |
// } |
|
75 |
// } |
|
76 |
|
|
77 |
|
|
50 | 78 |
foreach ( $aUserID AS $key => $value) |
51 | 79 |
{ |
52 | 80 |
switch ($_SERVER['REQUEST_METHOD']) : |
... | ... | |
60 | 88 |
|
61 | 89 |
// Check if user id is a valid number and doesnt equal 1 |
62 | 90 |
if($user_id == 0){ |
63 |
msgQueue::add($MESSAGE['GENERIC_FORGOT_OPTIONS'] );
|
|
91 |
msgQueue::add($mLang->MESSAGE_GENERIC_FORGOT_OPTIONS );
|
|
64 | 92 |
return $bRetVal; |
65 | 93 |
} |
66 | 94 |
|
67 | 95 |
if( ($user_id < 2 ) ) |
68 | 96 |
{ |
69 | 97 |
// if($admin_header) { $admin->print_header(); } |
70 |
msgQueue::add($MESSAGE['GENERIC_SECURITY_ACCESS'] );
|
|
98 |
msgQueue::add($mLang->MESSAGE_GENERIC_SECURITY_ACCESS );
|
|
71 | 99 |
return $bRetVal; |
72 | 100 |
} |
73 | 101 |
|
... | ... | |
77 | 105 |
'WHERE `user_id` = '.$user_id; |
78 | 106 |
if( ($iDeleteUser = $database->get_one($sql)) != null ) { |
79 | 107 |
if($iDeleteUser) { |
80 |
// Delete the user
|
|
108 |
// Deactivate the user
|
|
81 | 109 |
$sql = 'UPDATE `'.TABLE_PREFIX.'users` SET '. |
82 | 110 |
'`active` = 0 '. |
83 | 111 |
'WHERE `user_id` = '.$user_id; |
84 | 112 |
if( $database->query($sql) ) { |
85 |
msgQueue::add($TEXT['USERS_DELETED'], true);
|
|
113 |
msgQueue::add($mLang->TEXT_USERS_MARKED_DELETED, true);
|
|
86 | 114 |
} |
87 | 115 |
} else { |
116 |
|
|
117 |
|
|
88 | 118 |
$sql = 'DELETE FROM `'.TABLE_PREFIX.'users` '. |
89 | 119 |
'WHERE `user_id` = '.$user_id; |
90 | 120 |
if( $database->query($sql) ) { |
91 |
msgQueue::add($MESSAGE['USERS_DELETED'], true);
|
|
121 |
msgQueue::add($mLang->MESSAGE_USERS_DELETED, true);
|
|
92 | 122 |
} |
93 | 123 |
} |
94 | 124 |
$bRetVal = true; |
branches/2.8.x/wb/admin/users/index.php | ||
---|---|---|
33 | 33 |
|
34 | 34 |
function admin_users_index($aActionRequest) |
35 | 35 |
{ |
36 |
global $MESSAGE; |
|
37 | 36 |
$database = WbDatabase::getInstance(); |
37 |
$mLang = Translate::getinstance(); |
|
38 |
$mLang->enableAddon('admin\users'); |
|
38 | 39 |
|
39 | 40 |
$sAdminPath = dirname(str_replace('\\', '/', __FILE__)); |
40 | 41 |
$sAdminName = basename($sAdminPath); |
... | ... | |
91 | 92 |
// Check if user id is a valid number and doesnt equal 1 |
92 | 93 |
$aActionRequest['user_id'] = $user_id; |
93 | 94 |
if($user_id == 0){ |
94 |
msgQueue::add($MESSAGE['GENERIC_FORGOT_OPTIONS'] ); |
|
95 |
$admin = new admin('Access', 'users'); |
|
96 |
msgQueue::clear(); |
|
97 |
msgQueue::add($mLang->MESSAGE_GENERIC_FORGOT_OPTIONS ); |
|
98 |
$aActionRequest['user_id'] = $user_id; |
|
99 |
$aActionRequest['cancel_url'] = ADMIN_URL.'/access/index.php'; |
|
100 |
include($sAdminPath.'/user_list.php'); |
|
101 |
$output = show_userlist($admin, $aActionRequest); |
|
102 |
break; |
|
95 | 103 |
} |
96 | 104 |
|
97 | 105 |
if( ($user_id == $admin->get_user_id() ) ) |
... | ... | |
105 | 113 |
if( ($user_id < 2 ) ) |
106 | 114 |
{ |
107 | 115 |
// if($admin_header) { $admin->print_header(); } |
108 |
msgQueue::add($MESSAGE['GENERIC_SECURITY_ACCESS'] );
|
|
116 |
msgQueue::add($mLang->MESSAGE_GENERIC_SECURITY_ACCESS );
|
|
109 | 117 |
} |
110 | 118 |
$admin_header = false; |
111 | 119 |
if(isset($aActionRequest['BackLink'])) { |
... | ... | |
127 | 135 |
// Check if user id is a valid number and doesnt equal 1 |
128 | 136 |
$aActionRequest['user_id'] = $user_id; |
129 | 137 |
$aActionRequest['cancel_url'] = ADMIN_URL.'/access/index.php'; |
130 |
|
|
131 | 138 |
if($user_id > 1) // prevent 'admin' [ID 1] from modify |
132 | 139 |
{ |
133 | 140 |
include($sAdminPath.'/user_form.php'); |
branches/2.8.x/wb/admin/users/add.php | ||
---|---|---|
25 | 25 |
|
26 | 26 |
function add_user($admin, &$aActionRequest) |
27 | 27 |
{ |
28 |
global $MESSAGE,$TEXT, $HEADING; |
|
29 | 28 |
$database = WbDatabase::getInstance(); |
29 |
$mLang = Translate::getInstance(); |
|
30 | 30 |
$bRetVal = false; |
31 | 31 |
$iMinPassLength = 6; |
32 | 32 |
|
33 | 33 |
if( !$admin->checkFTAN() ) |
34 | 34 |
{ |
35 | 35 |
// $admin->print_header(); |
36 |
msgQueue::add($MESSAGE['GENERIC_SECURITY_ACCESS']);
|
|
36 |
msgQueue::add($mLang->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
37 | 37 |
return $bRetVal; |
38 | 38 |
} |
39 | 39 |
|
... | ... | |
63 | 63 |
// Check values |
64 | 64 |
// Check values |
65 | 65 |
if($groups_id == "") { |
66 |
msgQueue::add($MESSAGE['USERS_NO_GROUP']);
|
|
66 |
msgQueue::add($mLang->MESSAGE_USERS_NO_GROUP);
|
|
67 | 67 |
} else { |
68 | 68 |
$aGroups_id = explode(',', $groups_id); |
69 | 69 |
//if user is in administrator-group, get this group else just get the first one |
... | ... | |
71 | 71 |
} |
72 | 72 |
|
73 | 73 |
if(!preg_match('/^[a-z]{1}[a-z0-9_-]{2,}$/i', $username)) { |
74 |
msgQueue::add( $MESSAGE['USERS_NAME_INVALID_CHARS']);
|
|
74 |
msgQueue::add( $mLang->MESSAGE_USERS_NAME_INVALID_CHARS);
|
|
75 | 75 |
} |
76 | 76 |
|
77 | 77 |
$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'users` '. |
... | ... | |
79 | 79 |
// Check if username already exists |
80 | 80 |
if( ($iFoundUser = $database->get_one($sql)) != null ) { |
81 | 81 |
if($iFoundUser) { |
82 |
msgQueue::add($MESSAGE['USERS_USERNAME_TAKEN']);
|
|
82 |
msgQueue::add($mLang->MESSAGE_USERS_USERNAME_TAKEN);
|
|
83 | 83 |
} |
84 | 84 |
} |
85 | 85 |
|
86 | 86 |
if(strlen($password) < $iMinPassLength ) { |
87 |
msgQueue::add($MESSAGE['USERS_PASSWORD_TOO_SHORT']);
|
|
87 |
msgQueue::add($mLang->MESSAGE_USERS_PASSWORD_TOO_SHORT);
|
|
88 | 88 |
} |
89 | 89 |
|
90 | 90 |
$pattern = '/[^'.$admin->password_chars.']/'; |
91 | 91 |
if (preg_match($pattern, $password)) { |
92 |
msgQueue::add($MESSAGE['PREFERENCES_INVALID_CHARS']);
|
|
92 |
msgQueue::add($mLang->MESSAGE_PREFERENCES_INVALID_CHARS);
|
|
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
if(($password != $password2) ) { |
96 |
msgQueue::add($MESSAGE['USERS_PASSWORD_MISMATCH']);
|
|
96 |
msgQueue::add($mLang->MESSAGE__USERS_PASSWORD_MISMATCH);
|
|
97 | 97 |
} |
98 | 98 |
|
99 | 99 |
// |
... | ... | |
101 | 101 |
$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'users` '; |
102 | 102 |
$sql .= 'WHERE `user_id` <> '.(int)$admin->get_user_id().' AND `display_name` LIKE "'.$display_name.'"'; |
103 | 103 |
if( ($iFoundUser = intval($database->get_one($sql))) > 0 ){ |
104 |
msgQueue::add($MESSAGE['USERS_USERNAME_TAKEN'].' ('.$TEXT['DISPLAY_NAME'].')');
|
|
104 |
msgQueue::add($mLang->MESSAGE_USERS_USERNAME_TAKEN.' ('.$mLang->TEXT_DISPLAY_NAME.')');
|
|
105 | 105 |
} else { |
106 | 106 |
if($display_name == '') { |
107 |
msgQueue::add($MESSAGE['GENERIC_FILL_IN_ALL'].' ('.$TEXT['DISPLAY_NAME'].')');
|
|
107 |
msgQueue::add($mLang->MESSAGE_GENERIC_FILL_IN_ALL.' ('.$mLang->TEXT_DISPLAY_NAME.')');
|
|
108 | 108 |
} |
109 | 109 |
} |
110 | 110 |
|
111 | 111 |
if(findStringInFileList($display_name, dirname(__FILE__).'/disallowedNames')) { |
112 |
msgQueue::add( $TEXT['ERROR'].' '.$TEXT['DISPLAY_NAME'].' ('.$display_name.')' );
|
|
112 |
msgQueue::add( $mLang->TEXT_ERROR.' '.$mLang->TEXT_DISPLAY_NAME.' ('.$display_name.')' );
|
|
113 | 113 |
} |
114 | 114 |
|
115 | 115 |
if($email != "") |
116 | 116 |
{ |
117 | 117 |
if($admin->validate_email($email) == false) |
118 | 118 |
{ |
119 |
msgQueue::add($MESSAGE['USERS_INVALID_EMAIL'].' ('.$email.')');
|
|
119 |
msgQueue::add($mLang->MESSAGE_USERS_INVALID_EMAIL.' ('.$email.')');
|
|
120 | 120 |
} |
121 | 121 |
} else { // e-mail must be present |
122 |
msgQueue::add($MESSAGE['SIGNUP_NO_EMAIL']);
|
|
122 |
msgQueue::add($mLang->MESSAGE_SIGNUP_NO_EMAIL);
|
|
123 | 123 |
} |
124 | 124 |
|
125 | 125 |
$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'users` '. |
... | ... | |
128 | 128 |
// Check if the email already exists |
129 | 129 |
if( ($iFoundUser = $database->get_one($sql)) != null ) { |
130 | 130 |
if($iFoundUser) { |
131 |
if(isset($MESSAGE['USERS_EMAIL_TAKEN']))
|
|
131 |
if(isset($mLang->MESSAGE_USERS_EMAIL_TAKEN))
|
|
132 | 132 |
{ |
133 |
msgQueue::add($MESSAGE['USERS_EMAIL_TAKEN'].' ('.$email.')');
|
|
133 |
msgQueue::add($mLang->MESSAGE_USERS_EMAIL_TAKEN.' ('.$email.')');
|
|
134 | 134 |
} else { |
135 |
msgQueue::add($MESSAGE['USERS_INVALID_EMAIL'].' ('.$email.')');
|
|
135 |
msgQueue::add($mLang->MESSAGE_USERS_INVALID_EMAIL.' ('.$email.')');
|
|
136 | 136 |
} |
137 | 137 |
} |
138 | 138 |
} |
... | ... | |
150 | 150 |
$sHomeFolder = WB_PATH.MEDIA_DIRECTORY.'/home/'.( media_filename($username) ); |
151 | 151 |
if ( sizeof(createFolderProtectFile( $sHomeFolder )) ) |
152 | 152 |
{ |
153 |
msgQueue::add($MESSAGE['MEDIA_DIR_NOT_MADE'].' ('.basename($sHomeFolder).') ' );
|
|
153 |
msgQueue::add($mLang->MESSAGE_MEDIA_DIR_NOT_MADE.' ('.basename($sHomeFolder).') ' );
|
|
154 | 154 |
} |
155 | 155 |
} |
156 | 156 |
// Inser the user into the database |
... | ... | |
175 | 175 |
'`login_ip` = \''.$database->escapeString($login_ip).'\' '. |
176 | 176 |
''; |
177 | 177 |
if($database->query($sql)) { |
178 |
msgQueue::add($MESSAGE['USERS_ADDED'], true);
|
|
178 |
msgQueue::add($mLang->MESSAGE_USERS_ADDED, true);
|
|
179 | 179 |
$bRetVal = true; |
180 | 180 |
} |
181 | 181 |
if($database->is_error()) { |
182 | 182 |
msgQueue::add( implode('<br />',explode(';',$database->get_error())) ); |
183 | 183 |
} |
184 | 184 |
} else { |
185 |
msgQueue::add($HEADING['ADD_USER'].' '.$MESSAGE['GENERIC_NOT_COMPARE']);
|
|
185 |
msgQueue::add($mLang->HEADING_ADD_USER.' '.$mLang->MESSAGE_GENERIC_NOT_COMPARE);
|
|
186 | 186 |
|
187 | 187 |
} |
188 | 188 |
return $bRetVal; |
Also available in: Unified diff