Changeset 2566:9bf417837888 for admin/user.php
- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/user.php
r2342 r2566 45 45 try { 46 46 $rs = $core->getUser($_REQUEST['id']); 47 47 48 48 $user_id = $rs->user_id; 49 49 $user_super = $rs->user_super; … … 58 58 $user_tz = $rs->user_tz; 59 59 $user_post_status = $rs->user_post_status; 60 60 61 61 $user_options = array_merge($user_options,$rs->options()); 62 62 63 63 $page_title = $user_id; 64 64 } catch (Exception $e) { … … 75 75 throw new Exception(__('Password verification failed')); 76 76 } 77 77 78 78 $cur = $core->con->openCursor($core->prefix.'user'); 79 79 80 80 $cur->user_id = $_POST['user_id']; 81 81 $cur->user_super = $user_super = !empty($_POST['user_super']) ? 1 : 0; … … 88 88 $cur->user_tz = $user_tz = $_POST['user_tz']; 89 89 $cur->user_post_status = $user_post_status = $_POST['user_post_status']; 90 90 91 91 if ($cur->user_id == $core->auth->userID() && $core->auth->isSuperAdmin()) { 92 92 // force super_user to true if current user … … 96 96 $cur->user_change_pwd = !empty($_POST['user_change_pwd']) ? 1 : 0; 97 97 } 98 98 99 99 if (!empty($_POST['new_pwd'])) { 100 100 if ($_POST['new_pwd'] != $_POST['new_pwd_c']) { … … 104 104 } 105 105 } 106 106 107 107 $user_options['post_format'] = $_POST['user_post_format']; 108 108 $user_options['edit_size'] = (integer) $_POST['user_edit_size']; 109 109 110 110 if ($user_options['edit_size'] < 1) { 111 111 $user_options['edit_size'] = 10; 112 112 } 113 113 114 114 $cur->user_options = new ArrayObject($user_options); 115 115 116 116 # Udate user 117 117 if ($user_id) … … 119 119 # --BEHAVIOR-- adminBeforeUserUpdate 120 120 $core->callBehavior('adminBeforeUserUpdate',$cur,$user_id); 121 121 122 122 $new_id = $core->updUser($user_id,$cur); 123 123 124 124 # --BEHAVIOR-- adminAfterUserUpdate 125 125 $core->callBehavior('adminAfterUserUpdate',$cur,$new_id); 126 126 127 127 if ($user_id == $core->auth->userID() && 128 128 $user_id != $new_id) { 129 129 $core->session->destroy(); 130 130 } 131 131 132 132 dcPage::addSuccessNotice(__('User has been successfully updated.')); 133 133 http::redirect('user.php?id='.$new_id); … … 139 139 throw new Exception(sprintf(__('User "%s" already exists.'),html::escapeHTML($cur->user_id))); 140 140 } 141 141 142 142 # --BEHAVIOR-- adminBeforeUserCreate 143 143 $core->callBehavior('adminBeforeUserCreate',$cur); 144 144 145 145 $new_id = $core->addUser($cur); 146 146 147 147 # --BEHAVIOR-- adminAfterUserCreate 148 148 $core->callBehavior('adminAfterUserCreate',$cur,$new_id); 149 149 150 150 dcPage::addSuccessNotice(__('User has been successfully created.')); 151 151 if (!empty($_POST['saveplus'])) { … … 180 180 "\n//]]>\n". 181 181 "</script>\n". 182 182 183 183 # --BEHAVIOR-- adminUserHeaders 184 184 $core->callBehavior('adminUserHeaders'), … … 299 299 $core->callBehavior('adminUserForm',isset($rs) ? $rs : null); 300 300 301 echo 301 echo 302 302 '</div>'. 303 303 '</div>'; … … 332 332 '</p>'. 333 333 '</form>'; 334 334 335 335 $permissions = $core->getUserPermissions($user_id); 336 336 $perm_types = $core->auth->getPermissionsTypes(); 337 337 338 338 if (count($permissions) == 0) 339 339 { … … 346 346 if (count($v['p']) > 0) 347 347 { 348 echo 348 echo 349 349 '<form action="users_actions.php" method="post" class="perm-block">'. 350 350 '<p class="blog-perm">'.__('Blog:').' <a href="blog.php?id='.html::escapeHTML($k).'">'. 351 351 html::escapeHTML($v['name']).'</a> ('.html::escapeHTML($k).')</p>'; 352 352 353 353 echo '<ul class="ul-perm">'; 354 354 foreach ($v['p'] as $p => $V) { … … 369 369 } 370 370 } 371 } 372 373 } 371 } 372 373 } 374 374 else { 375 375 echo '<p>'.sprintf(__('%s is super admin (all rights on all blogs).'),'<strong>'.$user_id.'</strong>').'</p>'; 376 } 376 } 377 377 echo '</div>'; 378 378 } … … 380 380 dcPage::helpBlock('core_user'); 381 381 dcPage::close(); 382 ?>
Note: See TracChangeset
for help on using the changeset viewer.