/** * Get all running virtual servers * @return array all running virtual servers */ public function getRunningServers() { if ($this->meta == null) { return array(); } $servers = $this->meta->getBootedServers(); $filtered = array(); foreach ($servers as $server) { if (HelperFunctions::getActiveSection() != 'admin' || PermissionManager::getInstance()->isAdminOfServer($server->id())) { // set icesecret context if set if (!empty($this->contextVars)) { $server = $server->ice_context($this->contextVars); } $filtered[] = $server; } } return $filtered; }
<div id="menu"> <ul> <?php if (!SessionManager::getInstance()->isAdmin()) { ?> <li<?php if (HelperFunctions::getActivePage() == 'login') { echo ' class="active"'; } ?> > <a href="./?page=login">Login</a> </li> <?php } else { HelperFunctions::echoMenuEntry('meta'); HelperFunctions::echoMenuEntry('server'); if (PermissionManager::getInstance()->serverCanEditAdmins()) { HelperFunctions::echoMenuEntry('admins'); } HelperFunctions::echoMenuEntry('logout'); ?> <li style="height:10px; font-size:10px; line-height:10px; margin-top:10px; border-bottom:black;">Back to…</li> <?php } ?> <li><a href="../user/"><-- User</a></li> </ul> </div>
echo $server->id(); ?> " title="Show Server Details"><img src="<?php echo SettingsManager::getInstance()->getThemeUrl(); ?> /img/server_details.png" alt="Show Server Details" /></a> </td> </tr><?php } ?> </tbody> </table> <?php if (PermissionManager::getInstance()->isGlobalAdmin()) { ?> <a class="jqlink mpi_tooltip" id="server_create" title="Create a new Server"><img src="<?php echo SettingsManager::getInstance()->getThemeUrl(); ?> /img/server_create.png" alt="Create a new Server" /></a><br/> <a class="jqlink" onclick="jq_meta_showDefaultConfig()">Show Default Config</a> <?php } ?> <div id="jq_information"> </div> <script type="text/javascript">/*<![CDATA[*/ $('#server_create').click(
); } function jq_server_getRegistrations(sid) { if (sid==null) { sid = <?php echo isset($_GET['sid']) ? $_GET['sid'] : 0; ?> ; } $.post("./?ajax=server_getRegistrations", { 'sid': sid }, function (data) { $('#jq_information').show().html(data); <?php if (PermissionManager::getInstance()->serverCanEditRegistrations($_GET['sid'])) { ?> $('#jq_information').prepend('<p style="font-size:x-small;">(Double-click entries to edit them)</p>'); $('.jq_editable').editable( { 'submit': 'save', 'cancel':'cancel', 'editBy': 'dblclick', 'onSubmit': function (content) { var domId = $(this).attr('id'); var sub = domId.substring(0, domId.lastIndexOf('_')); var id = domId.substring(domId.lastIndexOf('_')+1); if (id == 0) { alert('Changing the superuser account is not possible.'); jq_server_getRegistrations(sid); return;
public static function meta_server_information_update() { $serverId = isset($_POST['serverid']) ? intval($_POST['serverid']) : null; // user has rights? if (PermissionManager::getInstance()->serverCanEditConf($serverId)) { if ($serverId != null && isset($_POST['name']) && isset($_POST['allowlogin']) && isset($_POST['allowregistration']) && isset($_POST['forcemail']) && isset($_POST['authbymail'])) { $serverId = intval($_POST['serverid']); $name = $_POST['name']; $allowLogin = $_POST['allowlogin']; $allowRegistration = $_POST['allowregistration']; $forcemail = $_POST['forcemail']; $authByMail = $_POST['authbymail']; SettingsManager::getInstance()->setServerInformation($serverId, $name, $allowLogin, $allowRegistration, $forcemail, $authByMail); } else { MessageManager::addError(TranslationManager::getInstance()->getText('error_missing_values')); } } else { MessageManager::addError('You don’t have permission to do this.'); } }