Changeset 1620:542c321dc040 for admin/user.php
- Timestamp:
- 08/30/13 10:37:08 (12 years ago)
- Branch:
- default
- Parents:
- 1619:5d925866b5b3 (diff), 1593:0c884219a872 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/user.php
r1583 r1620 15 15 dcPage::checkSuper(); 16 16 17 $page_title = __(' new user');17 $page_title = __('New user'); 18 18 19 19 $user_id = ''; … … 187 187 188 188 # --BEHAVIOR-- adminUserHeaders 189 $core->callBehavior('adminUserHeaders') 189 $core->callBehavior('adminUserHeaders'), 190 191 dcPage::breadcrumb( 192 array( 193 __('System') => '', 194 __('Users') => 'users.php', 195 '<span class="page-title">'.$page_title.'</span>' => '' 196 )) 190 197 ); 191 198 192 199 if (!empty($_GET['upd'])) { 193 dcPage:: message(__('User has been successfully updated.'));200 dcPage::success(__('User has been successfully updated.')); 194 201 } 195 202 196 203 if (!empty($_GET['add'])) { 197 dcPage::message(__('User has been successfully created.')); 198 } 199 200 echo '<h2><a href="users.php">'.__('Users').'</a> › <span class="page-title">'.$page_title.'</span></h2>'; 204 dcPage::success(__('User has been successfully created.')); 205 } 206 207 echo 208 '<form action="user.php" method="post" id="user-form" class="fieldset">'. 209 '<div class="two-cols">'. 210 211 '<div class="col">'. 212 '<h3>'.__('User profile').'</h3>'. 213 214 '<p><label for="user_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('User ID:').'</label> '. 215 form::field('user_id',20,255,html::escapeHTML($user_id)). 216 '</p>'. 217 '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p>'; 201 218 202 219 if ($user_id == $core->auth->userID()) { … … 231 248 232 249 '<p><label for="new_pwd_c" '.($user_id != '' ? '' : 'class="required"').'>'. 233 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Confirm password:').' '.250 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Confirm password:').'</label> '. 234 251 form::password('new_pwd_c',20,255). 235 '</label></p>'. 236 237 '<p><label for="user_name">'.__('Last Name:').' '. 238 form::field('user_name',20,255,html::escapeHTML($user_name)). 239 '</label></p>'. 240 241 '<p><label for="user_firstname">'.__('First Name:').' '. 242 form::field('user_firstname',20,255,html::escapeHTML($user_firstname)). 243 '</label></p>'. 244 245 '<p><label for="user_displayname">'.__('Display name:').' '. 246 form::field('user_displayname',20,255,html::escapeHTML($user_displayname)). 247 '</label></p>'. 248 249 '<p><label for="user_email">'.__('Email:').' '. 250 form::field('user_email',20,255,html::escapeHTML($user_email)). 251 '</label></p>'. 252 '<p class="form-note">'.__('Mandatory for password recovering procedure.').'</p>'. 253 '</div>'. 254 255 '<div class="col">'. 256 '<p><label for="user_url">'.__('URL:').' '. 257 form::field('user_url',30,255,html::escapeHTML($user_url)). 258 '</label></p>'. 259 '<p><label for="user_post_format">'.__('Preferred format:').' '. 260 form::combo('user_post_format',$formaters_combo,$user_options['post_format']). 261 '</label></p>'. 262 263 '<p><label for="user_post_status">'.__('Default entry status:').' '. 264 form::combo('user_post_status',$status_combo,$user_post_status). 265 '</label></p>'. 266 267 '<p><label for="user_edit_size">'.__('Entry edit field height:').' '. 268 form::field('user_edit_size',5,4,(integer) $user_options['edit_size']). 269 '</label></p>'. 270 271 '<p><label for="user_lang">'.__('User language:').' '. 272 form::combo('user_lang',$lang_combo,$user_lang,'l10n'). 273 '</label></p>'. 274 275 '<p><label for="user_tz">'.__('User timezone:').' '. 276 form::combo('user_tz',dt::getZones(true,true),$user_tz). 277 '</label></p>'; 252 '</p>'; 278 253 279 254 if ($core->auth->allowPassChange()) { … … 285 260 286 261 $super_disabled = $user_super && $user_id == $core->auth->userID(); 287 288 262 echo 289 263 '<p><label for="user_super" class="classic">'.form::checkbox('user_super','1',$user_super,'','',$super_disabled).' '. 290 264 __('Super administrator').'</label></p>'. 265 266 '<p><label for="user_name">'.__('Last Name:').'</label> '. 267 form::field('user_name',20,255,html::escapeHTML($user_name)). 268 '</p>'. 269 270 '<p><label for="user_firstname">'.__('First Name:').'</label> '. 271 form::field('user_firstname',20,255,html::escapeHTML($user_firstname)). 272 '</p>'. 273 274 '<p><label for="user_displayname">'.__('Display name:').'</label> '. 275 form::field('user_displayname',20,255,html::escapeHTML($user_displayname)). 276 '</p>'. 277 278 '<p><label for="user_email">'.__('Email:').'</label> '. 279 form::field('user_email',20,255,html::escapeHTML($user_email)). 280 '</p>'. 281 '<p class="form-note">'.__('Mandatory for password recovering procedure.').'</p>'. 282 283 '<p><label for="user_url">'.__('URL:').'</label> '. 284 form::field('user_url',30,255,html::escapeHTML($user_url)). 285 '</p>'. 291 286 '</div>'. 292 '</div>'. 293 '</fieldset>'; 287 288 '<div class="col">'. 289 '<h3>'.__('Options').'</h3>'. 290 '<h4>'.__('Interface').'</h4>'. 291 '<p><label for="user_lang">'.__('Language:').'</label> '. 292 form::combo('user_lang',$lang_combo,$user_lang,'l10n'). 293 '</p>'. 294 295 '<p><label for="user_tz">'.__('Timezone:').'</label> '. 296 form::combo('user_tz',dt::getZones(true,true),$user_tz). 297 '</p>'. 298 299 '<h4>'.__('Edition').'</h4>'. 300 '<p><label for="user_post_format">'.__('Preferred format:').'</label> '. 301 form::combo('user_post_format',$formaters_combo,$user_options['post_format']). 302 '</p>'. 303 304 '<p><label for="user_post_status">'.__('Default entry status:').'</label> '. 305 form::combo('user_post_status',$status_combo,$user_post_status). 306 '</p>'. 307 308 '<p><label for="user_edit_size">'.__('Entry edit field height:').'</label> '. 309 form::field('user_edit_size',5,4,(integer) $user_options['edit_size']). 310 '</p>'; 294 311 295 312 # --BEHAVIOR-- adminUserForm 296 313 $core->callBehavior('adminUserForm',isset($rs) ? $rs : null); 297 314 315 echo 316 '</div>'. 317 '</div>'; 318 319 298 320 echo 299 '<p ><label for="your_pwd" '.($user_id != '' ? '' : 'class="required"').'>'.300 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Your password:').301 form::password('your_pwd',20,255).'</ label></p>'.321 '<p class="clear border-top"><label for="your_pwd" class="required">'. 322 '<abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label>'. 323 form::password('your_pwd',20,255).'</p>'. 302 324 '<p class="clear"><input type="submit" name="save" accesskey="s" value="'.__('Save').'" />'. 303 325 ($user_id != '' ? '' : ' <input type="submit" name="saveplus" value="'.__('Save and create another').'" />'). … … 310 332 if ($user_id) 311 333 { 312 echo '<div class="clear fieldset"><h3>'.__('Permissions').'</h3>'. 313 '<form action="users_actions.php" method="post">'. 314 '<p><input type="submit" value="'.__('Add new permissions').'" />'. 315 form::hidden(array('redir'),'user.php?id='.$user_id). 316 form::hidden(array('action'),'blogs'). 317 form::hidden(array('users[]'),$user_id). 318 $core->formNonce(). 319 '</p>'. 320 '</form>'; 321 322 $permissions = $core->getUserPermissions($user_id); 323 $perm_types = $core->auth->getPermissionsTypes(); 324 325 if (count($permissions) == 0) 334 echo '<div class="clear fieldset">'. 335 '<h3>'.__('Permissions').'</h3>'; 336 337 if (!$user_super) 326 338 { 327 echo '<p>'.__('No permissions.').'</p>'; 328 } 329 else 330 { 331 foreach ($permissions as $k => $v) 339 echo 340 '<form action="users_actions.php" method="post">'. 341 '<p><input type="submit" value="'.__('Add new permissions').'" />'. 342 form::hidden(array('redir'),'user.php?id='.$user_id). 343 form::hidden(array('action'),'blogs'). 344 form::hidden(array('users[]'),$user_id). 345 $core->formNonce(). 346 '</p>'. 347 '</form>'; 348 349 $permissions = $core->getUserPermissions($user_id); 350 $perm_types = $core->auth->getPermissionsTypes(); 351 352 if (count($permissions) == 0) 332 353 { 333 if (count($v['p']) > 0) 354 echo '<p>'.__('No permissions so far.').'</p>'; 355 } 356 else 357 { 358 foreach ($permissions as $k => $v) 334 359 { 335 echo 336 '<form action="users_actions.php" method="post">'. 337 '<h4><a href="blog.php?id='.html::escapeHTML($k).'">'. 338 html::escapeHTML($v['name']).'</a> ('.html::escapeHTML($k).')</h4>'; 339 340 echo '<ul>'; 341 foreach ($v['p'] as $p => $V) { 342 if (isset($perm_types[$p])) { 343 echo '<li>'.__($perm_types[$p]).'</li>'; 360 if (count($v['p']) > 0) 361 { 362 echo 363 '<form action="users_actions.php" method="post">'. 364 '<p class="blog-perm">'.__('Blog:').' <a href="blog.php?id='.html::escapeHTML($k).'">'. 365 html::escapeHTML($v['name']).'</a> ('.html::escapeHTML($k).')</p>'; 366 367 echo '<ul class="ul-perm">'; 368 foreach ($v['p'] as $p => $V) { 369 if (isset($perm_types[$p])) { 370 echo '<li>'.__($perm_types[$p]).'</li>'; 371 } 344 372 } 373 echo 374 '</ul>'. 375 '<p class="add-perm"><input type="submit" class="reset" value="'.__('Change permissions').'" />'. 376 form::hidden(array('redir'),'user.php?id='.$user_id). 377 form::hidden(array('action'),'perms'). 378 form::hidden(array('users[]'),$user_id). 379 form::hidden(array('blogs[]'),$k). 380 $core->formNonce(). 381 '</p>'. 382 '</form>'; 345 383 } 346 echo '</ul>'. 347 '<p><input type="submit" value="'.__('Change permissions').'" />'. 348 form::hidden(array('redir'),'user.php?id='.$user_id). 349 form::hidden(array('action'),'perms'). 350 form::hidden(array('users[]'),$user_id). 351 form::hidden(array('blogs[]'),$k). 352 $core->formNonce(). 353 '</p>'. 354 '</form>'; 355 } 356 } 357 } 358 384 } 385 } 386 387 } 388 else { 389 echo '<p>'.sprintf(__('User %s is super admin.'),$user_id).'</p>'; 390 } 359 391 echo '</div>'; 360 392 } -
admin/user.php
r1609 r1620 172 172 dcPage::open($page_title, 173 173 dcPage::jsConfirmClose('user-form'). 174 dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 175 '<script type="text/javascript">'."\n". 176 "//<![CDATA[\n". 177 "\$(function() {\n". 178 " \$('#new_pwd').pwstrength({texts: ['". 179 sprintf(__('Password strength: %s'),__('very weak'))."', '". 180 sprintf(__('Password strength: %s'),__('weak'))."', '". 181 sprintf(__('Password strength: %s'),__('mediocre'))."', '". 182 sprintf(__('Password strength: %s'),__('strong'))."', '". 183 sprintf(__('Password strength: %s'),__('very strong'))."']});\n". 184 "});\n". 185 "\n//]]>\n". 186 "</script>\n". 174 187 175 188 # --BEHAVIOR-- adminUserHeaders … … 211 224 212 225 echo 213 '<p><label for="new_pwd" '.($user_id != '' ? '' : 'class="required"').'>'. 214 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> '). 215 ($user_id != '' ? __('New password:') : __('Password:')).'</label> '. 216 form::password('new_pwd',20,255). 217 '</p>'. 226 '<form action="user.php" method="post" id="user-form">'. 227 '<fieldset><legend>'.__('User information').'</legend>'. 228 '<div class="two-cols">'. 229 '<div class="col">'. 230 '<p><label for="user_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '. 231 form::field('user_id',20,255,html::escapeHTML($user_id)). 232 '</label></p>'. 233 '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p>'. 234 235 '<div class="pw-table">'. 236 '<p class="pw-cell">'. 237 '<label for="new_pwd" '.($user_id != '' ? '' : 'class="required"').'>'. 238 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> '). 239 ($user_id != '' ? __('New password:') : __('Password:')).'</label>'. 240 form::password('new_pwd',20,255,'','','',false,' data-indicator="pwindicator" '). 241 '</p>'. 242 '<div id="pwindicator">'. 243 ' <div class="bar"></div>'. 244 ' <p class="label no-margin"></p>'. 245 '</div>'. 246 '</div>'. 218 247 '<p class="form-note">'.__('Password must contain at least 6 characters.').'</p>'. 219 248
Note: See TracChangeset
for help on using the changeset viewer.