tbrehm
2011-09-26 b31bb1f27f066a2d49f5ab9ee0ca15e985efc788
interface/web/admin/users_edit.php
@@ -1,6 +1,6 @@
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
Copyright (c) 2008, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -41,16 +41,36 @@
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
   header("Location: ../index.php");
   exit;
}
//* Check permissions for module
$app->auth->check_module_permissions('admin');
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
// let tform_actions handle the page
$app->tform_actions->onLoad();
class page_action extends tform_actions {
   function onBeforeInsert() {
      global $app, $conf;
      if(!in_array($this->dataRecord['startmodule'],$this->dataRecord['modules'])) {
         $app->tform->errorMessage .= $app->tform->wordbook['startmodule_err'];
      }
   }
   function onBeforeUpdate() {
      global $app, $conf;
      if($conf['demo_mode'] == true && $_REQUEST['id'] <= 3) $app->error('This function is disabled in demo mode.');
      if(@is_array($this->dataRecord['modules']) && !in_array($this->dataRecord['startmodule'],$this->dataRecord['modules'])) {
         $app->tform->errorMessage .= $app->tform->wordbook['startmodule_err'];
      }
   }
}
$page = new page_action;
$page->onLoad();
?>