Exemplo n.º 1
0
*/
require_once "../alloc.php";
$permission = new permission();
$permissionID = $_POST["permissionID"] or $permissionID = $_GET["permissionID"];
if ($permissionID) {
    $permission->set_id($permissionID);
    $permission->select();
}
$actions_array = $_POST["actions_array"];
if (is_array($actions_array)) {
    $actions = 0;
    foreach ($actions_array as $k => $a) {
        $actions = $actions | $a;
    }
}
$permission->read_globals();
$permission->set_values();
if (!$permission->get_value("tableName")) {
    global $modules;
    $entities = array();
    reset($modules);
    while (list($module_name, $module) = each($modules)) {
        $mod_entities = $module->db_entities;
        $entities = array_merge($entities, $mod_entities);
    }
    $table_names = array();
    reset($entities);
    while (list(, $entity_name) = each($entities)) {
        $entity = new $entity_name();
        $table_names[] = $entity->data_table;
    }