auth->check_module_permissions('tools'); if($_SESSION['s']['user']['typ'] == 'admin') { $app->auth->check_security_permissions('admin_allow_new_admin'); } // Loading classes $app->uses('tpl,tform,tform_actions'); $app->load('tform_actions'); class page_action extends tform_actions { function onLoad() { global $app, $conf, $tform_def_file; // Loading template classes and initialize template if(!is_object($app->tpl)) $app->uses('tpl'); if(!is_object($app->tform)) $app->uses('tform'); $app->tpl->newTemplate("tabbed_form.tpl.htm"); // Load table definition from file $app->tform->loadFormDef($tform_def_file); // Importing ID $this->id = $app->functions->intval($_SESSION['s']['user']['userid']); $_POST['id'] = $_SESSION['s']['user']['userid']; if(count($_POST) > 1) { $this->dataRecord = $_POST; $this->onSubmit(); } else { $this->onShow(); } } function onInsert() { die('No inserts allowed.'); } function onBeforeUpdate() { global $app, $conf; if($conf['demo_mode'] == true && $this->id <= 3) $app->tform->errorMessage .= 'This function is disabled in demo mode.'; if($_POST['passwort'] != $_POST['repeat_password']) { $app->tform->errorMessage = $app->tform->lng('password_mismatch'); } if(preg_match('/[a-z]{2}/',$_POST['language'])) { $_SESSION['s']['user']['language'] = $_POST['language']; $_SESSION['s']['language'] = $_POST['language']; } else { $app->error('Invalid language.'); } } function onAfterUpdate() { global $app; if($_POST['passwort'] != '') { $tmp_user = $app->db->queryOneRecord("SELECT passwort FROM sys_user WHERE userid = '".$app->functions->intval($_SESSION['s']['user']['userid'])."'"); $_SESSION['s']['user']['passwort'] = $tmp_user['passwort']; unset($tmp_user); } } } $page = new page_action; $page->onLoad(); ?>