Changeset 2566:9bf417837888 for inc/admin/prepend.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
-
inc/admin/prepend.php
r2277 r2566 24 24 function dc_load_locales() { 25 25 global $_lang, $core; 26 26 27 27 $_lang = $core->auth->getInfo('user_lang'); 28 28 $_lang = preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$_lang) ? $_lang : 'en'; 29 29 30 30 l10n::lang($_lang); 31 31 if (l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/date') === false && $_lang != 'en') { … … 40 40 { 41 41 global $core; 42 42 43 43 $core->auth->user_prefs->addWorkspace('interface'); 44 44 $user_ui_iconset = @$core->auth->user_prefs->interface->iconset; 45 45 if (($user_ui_iconset) && ($img)) { 46 46 $icon = false; 47 if ((preg_match('/^images\/menu\/(.+)$/',$img,$m)) || 47 if ((preg_match('/^images\/menu\/(.+)$/',$img,$m)) || 48 48 (preg_match('/^index\.php\?pf=(.+)$/',$img,$m))) { 49 49 if ($m[1]) { … … 65 65 # We have session information in constants 66 66 $_COOKIE[DC_SESSION_NAME] = DC_AUTH_SESS_ID; 67 67 68 68 if (!$core->auth->checkSession(DC_AUTH_SESS_UID)) { 69 69 throw new Exception('Invalid session data.'); 70 70 } 71 71 72 72 # Check nonce from POST requests 73 73 if (!empty($_POST)) … … 77 77 } 78 78 } 79 79 80 80 if (empty($_SESSION['sess_blog_id'])) { 81 81 throw new Exception('Permission denied.'); 82 82 } 83 83 84 84 # Loading locales 85 85 dc_load_locales(); 86 86 87 87 $core->setBlog($_SESSION['sess_blog_id']); 88 88 if (!$core->blog->id) { … … 100 100 $p[3] = '/'; 101 101 call_user_func_array('setcookie',$p); 102 102 103 103 http::redirect('auth.php'); 104 104 } … … 108 108 ,20); 109 109 } 110 110 111 111 # Check nonce from POST requests 112 112 if (!empty($_POST)) … … 119 119 } 120 120 } 121 122 121 122 123 123 if (!empty($_REQUEST['switchblog']) 124 124 && $core->auth->getPermissions($_REQUEST['switchblog']) !== false) … … 131 131 unset($_SESSION['media_manager_page']); 132 132 } 133 133 134 134 # Removing switchblog from URL 135 135 $redir = $_SERVER['REQUEST_URI']; … … 139 139 exit; 140 140 } 141 141 142 142 # Check blog to use and log out if no result 143 143 if (isset($_SESSION['sess_blog_id'])) … … 154 154 } 155 155 } 156 156 157 157 # Loading locales 158 158 dc_load_locales(); 159 159 160 160 if (isset($_SESSION['sess_blog_id'])) { 161 161 $core->setBlog($_SESSION['sess_blog_id']); … … 165 165 } 166 166 167 /* 167 /* 168 168 # Check add to my fav fired 169 169 if (!empty($_REQUEST['add-favorite'])) { … … 184 184 } 185 185 unset($f); 186 186 187 187 if (($hfiles = @scandir($locales_root.$_lang.'/help')) !== false) 188 188 { … … 205 205 # [] : Title, URL, small icon, large icon, permissions, id, class 206 206 # NB : '*' in permissions means any, null means super admin only 207 208 207 208 209 209 # Menus creation 210 210 $_menu = new ArrayObject(); … … 219 219 $core->plugins->loadModules(DC_PLUGINS_ROOT,'admin',$_lang); 220 220 $core->favs->setup(); 221 221 222 222 if (!$user_ui_nofavmenu) { 223 223 $core->favs->appendMenu($_menu); 224 224 } 225 225 226 226 227 227 # Set menu titles 228 228 229 229 $_menu['System']->title = __('System settings'); 230 230 $_menu['Blog']->title = __('Blog'); … … 256 256 preg_match('/post.php$/',$_SERVER['REQUEST_URI']), 257 257 $core->auth->check('usage,contentadmin',$core->blog->id)); 258 258 259 259 $_menu['System']->prependItem(__('Update'),'update.php','images/menu/update.png', 260 260 preg_match('/update.php(\?.*)?$/',$_SERVER['REQUEST_URI']), … … 273 273 $core->auth->isSuperAdmin() || 274 274 $core->auth->check('usage,contentadmin',$core->blog->id) && $core->auth->getBlogCount() > 1); 275 275 276 276 if (empty($core->blog->settings->system->jquery_migrate_mute)) { 277 277 $core->blog->settings->system->put('jquery_migrate_mute', true, 'boolean', 'Mute warnings for jquery migrate plugin ?', false); 278 278 } 279 279 } 280 ?>
Note: See TracChangeset
for help on using the changeset viewer.