auth->check_module_permissions('mail'); // Loading classes $app->uses('tpl,tform,tform_actions'); $app->load('tform_actions'); class page_action extends tform_actions { function onShowNew() { global $app, $conf; if($_SESSION["s"]["user"]["typ"] != 'admin') die('This function needs admin priveliges'); parent::onShowNew(); } function onBeforeUpdate() { global $app, $conf; if($_SESSION["s"]["user"]["typ"] != 'admin') die('This function needs admin priveliges'); //* Check if the server has been changed // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway $rec = $app->db->queryOneRecord("SELECT server_id from mail_access WHERE access_id = ?", $this->id); if($rec['server_id'] != $this->dataRecord["server_id"]) { //* Add a error message and switch back to old server $app->tform->errorMessage .= $app->lng('The Server can not be changed.'); $this->dataRecord["server_id"] = $rec['server_id']; } unset($rec); } function onSubmit() { global $app, $conf; if($_SESSION["s"]["user"]["typ"] != 'admin') die('This function needs admin priveliges'); if(substr($this->dataRecord['source'], 0, 1) === '@') $this->dataRecord['source'] = substr($this->dataRecord['source'], 1); parent::onSubmit(); } } $app->tform_actions = new page_action; $app->tform_actions->onLoad(); ?>