Commit d4d985e0 authored by tbrehm's avatar tbrehm
Browse files

Data records are now assigned to the correct client group if they were created...

Data records are now assigned to the correct client group if they were created by the administrator.
parent c2d9267b
......@@ -50,6 +50,8 @@ $app->load('tform_actions');
class page_action extends tform_actions {
var $parent_domain_record;
function onShowNew() {
global $app, $conf;
......@@ -97,10 +99,19 @@ class page_action extends tform_actions {
$this->dataRecord["server_id"] = $parent_domain["server_id"];
$this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"];
$this->parent_domain_record = $parent_domain;
parent::onSubmit();
}
function onAfterInsert() {
global $app, $conf;
$app->db->query('UPDATE web_domain SET sys_groupid = '.intval($this->parent_domain_record['sys_groupid']).' WHERE domain_id = '.$this->id);
}
}
$page = new page_action;
......
......@@ -69,7 +69,7 @@ $form['db_table_idx'] = 'userid';
$form["db_history"] = "no";
$form['tab_default'] = 'users';
$form['list_default'] = 'index.php';
$form['auth'] = 'yes';
$form['auth'] = 'no';
//* 0 = id of the user, > 0 id must match with id of current user
$form['auth_preset']['userid'] = 0;
......
......@@ -64,6 +64,7 @@ class page_action extends tform_actions {
// Importing ID
$this->id = $_SESSION['s']['user']['userid'];
$_POST['id'] = $_SESSION['s']['user']['userid'];
if(count($_POST) > 1) {
$this->dataRecord = $_POST;
......@@ -72,6 +73,10 @@ class page_action extends tform_actions {
$this->onShow();
}
}
function onInsert() {
die('No inserts allowed.');
}
function onBeforeUpdate() {
global $app, $conf;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment