public function register() { $extensions = $this->activated(); foreach ($extensions as $extension) { if (!in_admin() || !in_array($extension, $this->adminExcepts)) { $extensionClass = $this->extensionClass($extension); if (!empty($extensionClass) && class_exists($extensionClass)) { $extension = new $extensionClass(); $extension->register(); } } } }
function ctrl_admin_project_updateitem() { in_admin(); try { if (getPost('uid')=='new') { $data = new stdClass(); $data->type = getPost('type'); $item = projects()->get(param(1))->addItem($data); } else { $item = projects()->get(param(1))->getItem(getPost('uid')); } $item->title = strip_tags(getPost('title')); $item->caption = strip_tags(getPost('caption',false),cfg('allowed_tags')); if ((getPost('src')!=null) && ($item->type==Project::ITEM_TYPE_EMBED)) { if(filter_var(getPost('src'), FILTER_VALIDATE_URL)) { $item->src = getPost('src'); } else { $json['message'] = "The url you provided is not valid."; $json['message_type'] = MESSAGE_ERROR; die(json_encode($json)); } } projects()->save(); $json['message'] = "Item updated."; $json['message_type'] = MESSAGE_SUCCESS; } catch (Exception $e) { $json['message'] = $e->getMessage(); $json['message_type'] = MESSAGE_ERROR; } echo json_encode($json); }
define('ADMIN_CLASSES_DIR', SESSIONMANAGER_ROOT_ADMIN . '/classes'); define('MODULES_DIR', SESSIONMANAGER_ROOT . '/modules'); define('EVENTS_DIR', SESSIONMANAGER_ROOT . '/events'); define('CALLBACKS_DIR', SESSIONMANAGER_ROOT . '/events/callbacks'); require_once dirname(__FILE__) . '/functions.inc.php'; require_once dirname(__FILE__) . '/load_balancing.inc.php'; require_once dirname(__FILE__) . '/defaults.inc.php'; if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $buf = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); $buf = explode(';', $buf[0]); $buf = $buf[0]; } else { $buf = 'en_GB'; } $language = locale2unix($buf); if (!in_admin()) { setlocale(LC_ALL, $language . '.UTF-8'); $domain = 'uovdsmadmin'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain); } if (!file_exists(SESSIONMANAGER_CONF_FILE)) { die_error('Configuration file missing', __FILE__, __LINE__); } @(include_once SESSIONMANAGER_CONF_FILE); $buf = conf_is_valid(); if ($buf !== true) { Logger::critical('main', 'Configuration not valid : ' . $buf); die_error('Configuration not valid : ' . $buf, __FILE__, __LINE__); } function __autoload($class_name)
function header_static($title_ = false) { $title_ = DEFAULT_PAGE_TITLE; $logo_url = DEFAULT_LOGO_URL; echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>'; if (in_admin()) { echo $title_ . ' - ' . _('Administration'); } else { echo $title_; } echo '</title> '; /*<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />*/ echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" type="image/png" href="media/image/favicon.ico" /> <link rel="stylesheet" type="text/css" href="media/style/common.css" /> <link rel="stylesheet" type="text/css" href="media/script/lib/nifty/niftyCorners.css" /> <script type="text/javascript" src="media/script/lib/nifty/niftyCorners.js" charset="utf-8"></script> <script type="text/javascript" charset="utf-8"> NiftyLoad = function() { Nifty(\'div.rounded\'); } </script> <script type="text/javascript" src="media/script/lib/prototype/prototype.js" charset="utf-8"></script> <script type="text/javascript" src="media/script/lib/scriptaculous/scriptaculous.js" charset="utf-8"></script> <script type="text/javascript" src="media/script/lib/scriptaculous/slider.js" charset="utf-8"></script> <script type="text/javascript" src="media/script/common-regular.js" charset="utf-8"></script> <script type="text/javascript" src="media/script/sortable.js" charset="utf-8"></script> <script type="text/javascript" src="media/script/common.js" charset="utf-8"></script> <script type="text/javascript" src="media/script/ajax/configuration.js" charset="utf-8"></script> </head> <body> <div id="mainWrap"> <div id="headerWrap" style="border-bottom: 1px solid #ccc;"> <table style="width: 100%;" border="0" cellspacing="0" cellpadding="0"> <tr> <td style="text-align: left" class="logo">'; if (isset($logo_url) && $logo_url != '') { echo '<a href="index.php"><img src="' . $logo_url . '" alt="' . $title_ . '" title="' . $title_ . '" /></a>'; } echo '</td> <td style="text-align: center; width: 100%;" class="title centered"> <h1 class="centered">'; if (in_admin()) { echo $title_ . ' - ' . _('Administration'); } else { echo $title_; } echo '</h1> </td> </tr> </table> </div> <div class="spacer"></div> <div id="pageWrap">'; if (isset($_GET['error']) && $_GET['error'] != '') { echo '<p class="msg_error">' . $_GET['error'] . '</p><br /><br />'; } }
* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ if (in_admin() && !isset($_SESSION['admin_login']) && basename($_SERVER['PHP_SELF']) != 'login.php') { $_SESSION['redirect'] = base64_encode($_SERVER['REQUEST_URI']); if (basename(dirname($_SERVER['PHP_SELF'])) != 'admin') { redirect('../login.php'); } else { redirect('login.php'); } } $menu = array(); $menu['main'] = array('id' => 'main', 'name' => _('Index'), 'page' => 'index.php', 'parent' => array(), 'always_display' => true); $menu['servers'] = array('id' => 'servers', 'name' => _('Servers'), 'page' => 'servers.php', 'parent' => array()); $menu['users'] = array('id' => 'users', 'name' => _('Users'), 'page' => 'users.php', 'parent' => array()); $menu['applications'] = array('id' => 'applications', 'name' => _('Applications'), 'page' => 'applications.php', 'parent' => array()); $menu['configuration'] = array('id' => 'configuration', 'name' => _('Configuration'), 'page' => 'configuration-sumup.php', 'parent' => array()); $menu['status'] = array('id' => 'status', 'name' => _('Status'), 'page' => 'sessions.php', 'parent' => array()); if (isAuthorized('viewServers')) {
function ext_scripts() { return in_admin() ? AdminThemeFacade::getExtJs() : HomeThemeFacade::getExtJs(); }