auth->check_module_permissions('admin'); $app->auth->check_security_permissions('admin_allow_server_services'); // Loading classes $app->uses('tpl,tform,tform_actions'); $app->load('tform_actions'); class page_action extends tform_actions { function onShowEnd() { global $app, $conf; // Getting Servers $sql = "SELECT server_id,server_name FROM server WHERE server_id != ? AND mirror_server_id != ? ORDER BY server_name"; $mirror_servers = $app->db->queryAllRecords($sql, $this->id, $this->id); $mirror_server_select = ''; if(is_array($mirror_servers)) { foreach( $mirror_servers as $mirror_server) { $selected = ($mirror_server["server_id"] == $this->dataRecord['mirror_server_id'])?'SELECTED':''; $mirror_server_select .= "\r\n"; } } $app->tpl->setVar("mirror_server_id", $mirror_server_select); parent::onShowEnd(); } function onSubmit() { global $app; //* We do not want to mirror the the server itself and the master can not be a mirror if($this->id == $this->dataRecord['mirror_server_id'] || $this->id == 1) $this->dataRecord['mirror_server_id'] = 0; parent::onSubmit(); } } $page = new page_action; $page->onLoad(); ?>