Changeset 2566:9bf417837888 for admin/preferences.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/preferences.php
r2449 r2566 47 47 $default_tab = !empty($_GET['tab']) ? html::escapeHTML($_GET['tab']) : 'user-profile'; 48 48 49 if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) || 50 !empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) || 49 if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) || 50 !empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) || 51 51 !empty($_GET['db-updated'])) { 52 52 $default_tab = 'user-favorites'; … … 84 84 { 85 85 $pwd_check = !empty($_POST['cur_pwd']) && $core->auth->checkPassword(crypt::hmac(DC_MASTER_KEY,$_POST['cur_pwd'])); 86 86 87 87 if ($core->auth->allowPassChange() && !$pwd_check && $user_email != $_POST['user_email']) { 88 88 throw new Exception(__('If you want to change your email or password you must provide your current password.')); 89 89 } 90 90 91 91 $cur = $core->con->openCursor($core->prefix.'user'); 92 92 93 93 $cur->user_name = $user_name = $_POST['user_name']; 94 94 $cur->user_firstname = $user_firstname = $_POST['user_firstname']; … … 100 100 101 101 $cur->user_options = new ArrayObject($user_options); 102 102 103 103 if ($core->auth->allowPassChange() && !empty($_POST['new_pwd'])) 104 104 { … … 106 106 throw new Exception(__('If you want to change your email or password you must provide your current password.')); 107 107 } 108 108 109 109 if ($_POST['new_pwd'] != $_POST['new_pwd_c']) { 110 110 throw new Exception(__("Passwords don't match")); 111 111 } 112 112 113 113 $cur->user_pwd = $_POST['new_pwd']; 114 114 } 115 115 116 116 # --BEHAVIOR-- adminBeforeUserUpdate 117 117 $core->callBehavior('adminBeforeUserProfileUpdate',$cur,$core->auth->userID()); 118 118 119 119 # Udate user 120 120 $core->updUser($core->auth->userID(),$cur); 121 121 122 122 # --BEHAVIOR-- adminAfterUserUpdate 123 123 $core->callBehavior('adminAfterUserProfileUpdate',$cur,$core->auth->userID()); 124 124 125 125 dcPage::addSuccessNotice(__('Personal information has been successfully updated.')); 126 126 … … 134 134 135 135 # Update user options 136 if (isset($_POST['user_post_format'])) 136 if (isset($_POST['user_post_format'])) 137 137 { 138 138 try 139 139 { 140 140 $cur = $core->con->openCursor($core->prefix.'user'); 141 141 142 142 $cur->user_name = $user_name; 143 143 $cur->user_firstname = $user_firstname; … … 149 149 150 150 $cur->user_post_status = $user_post_status = $_POST['user_post_status']; 151 151 152 152 $user_options['edit_size'] = (integer) $_POST['user_edit_size']; 153 153 if ($user_options['edit_size'] < 1) { … … 156 156 $user_options['post_format'] = $_POST['user_post_format']; 157 157 $user_options['enable_wysiwyg'] = !empty($_POST['user_wysiwyg']); 158 158 159 159 $cur->user_options = new ArrayObject($user_options); 160 160 161 161 # --BEHAVIOR-- adminBeforeUserOptionsUpdate 162 162 $core->callBehavior('adminBeforeUserOptionsUpdate',$cur,$core->auth->userID()); 163 163 164 164 # Update user prefs 165 165 $core->auth->user_prefs->accessibility->put('nodragdrop',!empty($_POST['user_acc_nodragdrop']),'boolean'); … … 170 170 } 171 171 $core->auth->user_prefs->interface->put('media_by_page',(integer)$_POST['user_ui_media_by_page'],'integer'); 172 172 173 173 # Udate user 174 174 $core->updUser($core->auth->userID(),$cur); 175 175 176 176 # --BEHAVIOR-- adminAfterUserOptionsUpdate 177 177 $core->callBehavior('adminAfterUserOptionsUpdate',$cur,$core->auth->userID()); 178 178 179 179 dcPage::addSuccessNotice(__('Personal options has been successfully updated.')); 180 180 http::redirect('preferences.php#user-options'); … … 192 192 # --BEHAVIOR-- adminBeforeUserOptionsUpdate 193 193 $core->callBehavior('adminBeforeDashboardOptionsUpdate',$core->auth->userID()); 194 194 195 195 # Update user prefs 196 196 $core->auth->user_prefs->dashboard->put('doclinks',!empty($_POST['user_dm_doclinks']),'boolean'); … … 199 199 $core->auth->user_prefs->interface->put('iconset',(!empty($_POST['user_ui_iconset']) ? $_POST['user_ui_iconset'] : '')); 200 200 $core->auth->user_prefs->interface->put('nofavmenu',empty($_POST['user_ui_nofavmenu']),'boolean'); 201 201 202 202 # --BEHAVIOR-- adminAfterUserOptionsUpdate 203 203 $core->callBehavior('adminAfterDashboardOptionsUpdate',$core->auth->userID()); 204 204 205 205 dcPage::addSuccessNotice(__('Dashboard options has been successfully updated.')); 206 206 http::redirect('preferences.php#user-favorites'); … … 213 213 214 214 # Add selected favorites 215 if (!empty($_POST['appendaction'])) 215 if (!empty($_POST['appendaction'])) 216 216 { 217 217 try { … … 280 280 unset($order[$k]); 281 281 } 282 } 282 } 283 283 $core->favs->setFavoriteIDs($order,false); 284 284 if (!$core->error->flag()) { … … 320 320 dcPage::jsPageTabs($default_tab). 321 321 dcPage::jsConfirmClose('user-form'). 322 322 323 323 # --BEHAVIOR-- adminPreferencesHeaders 324 324 $core->callBehavior('adminPreferencesHeaders'), … … 386 386 echo 387 387 '<h4 class="vertical-separator pretty-title">'.__('Change my password').'</h4>'. 388 388 389 389 '<div class="pw-table">'. 390 390 '<p class="pw-cell"><label for="new_pwd">'.__('New password:').'</label>'. … … 395 395 '</div>'. 396 396 '</div>'. 397 397 398 398 '<p><label for="new_pwd_c">'.__('Confirm new password:').'</label>'. 399 399 form::password('new_pwd_c',20,255).'</p>'. 400 400 401 401 '<p><label for="cur_pwd">'.__('Your current password:').'</label>'. 402 402 form::password('cur_pwd',20,255).'</p>'. … … 589 589 590 590 if (count($iconsets_combo) > 1) { 591 echo 591 echo 592 592 '<div class="fieldset">'. 593 593 '<h4>'.__('Dashboard icons').'</h4>'. … … 631 631 dcPage::helpBlock('core_user_pref'); 632 632 dcPage::close(); 633 ?>
Note: See TracChangeset
for help on using the changeset viewer.