Marius Cramer
2014-01-22 ad955792a8ade5c0015aa3d68f86b1035c1acc31
interface/web/client/domain_edit.php
@@ -38,8 +38,8 @@
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
//* Check permissions for module
$app->auth->check_module_permissions('client');
@@ -50,7 +50,7 @@
//* load language file
$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'.lng';
include($lng_file);
include $lng_file;
class page_action extends tform_actions {
@@ -69,7 +69,8 @@
      if($_SESSION["s"]["user"]["typ"] == 'admin') {
         // Getting Clients of the user
         $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
         //$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
         $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
         $clients = $app->db->queryAllRecords($sql);
         $client_select = '';
         if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
@@ -80,7 +81,7 @@
               $client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
            }
         }
         $app->tpl->setVar("client_group_id",$client_select);
         $app->tpl->setVar("client_group_id", $client_select);
      }
@@ -142,13 +143,14 @@
      // make sure that the record belongs to the client group and not the admin group when admin inserts it
      // also make sure that the user can not delete domain created by a admin
      if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
         $client_group_id = intval($this->dataRecord["client_group_id"]);
         $client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]);
         $app->db->query("UPDATE domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id);
      }
   }
}
$page = new page_action;
$page->onLoad();
?>
?>