Exemple #1
0
 public function SaveAll()
 {
     global $global;
     $saveType = $this->getSaveType();
     //var_dump('saving event type' ,  $saveType);
     if ($saveType == 'create') {
         acl_add_person($this->person_record_number);
         //if event is marked as confidential limit it to this user and admin.
         if ($this->confidentiality == 'y') {
             acl_set_person_permissions($this->person_record_number);
         }
     }
     if ($saveType == 'update') {
         //if event is marked as confidential limit it to this user and admin.
         if ($this->confidentiality == 'y') {
             acl_set_person_permissions($this->person_record_number);
         }
         if ($this->confidentiality == 'n') {
             acl_unset_person_permissions($this->person_record_number);
         }
     }
     parent::SaveAll();
 }
            require_once APPROOT . '3rd/Zend/ ' . $class_name . '.php';
        }
        if (file_exists(APPROOT . 'data/' . $class_name . '.php')) {
            require_once APPROOT . 'data/' . $class_name . '.php';
        }
    }
}
spl_autoload_register(array('AutoLoadClass', '__autoload'));
//include(APPROOT.'3rd/phpgacl/gacl.class.php');
include APPROOT . '3rd/phpgacl/gacl_api.class.php';
include APPROOT . 'inc/handler_db.inc';
#    	$gacl= new gacl(array('db_host'=> $conf['db_host'] , 'db_name'=> $conf['db_name'] , 'db_user'=> $conf['db_user'], 'db_password'=> $conf['db_pass'] , 'db_table_prefix'=>'gacl_' , 'db_type'=> 'mysql'  ));
#    	$gacl_api = new gacl_api(array('db_host'=> $conf['db_host'] , 'db_name'=> $conf['db_name'] , 'db_user'=> $conf['db_user'], 'db_password'=> $conf['db_pass'] , 'db_table_prefix'=>'gacl_' , 'db_type'=> 'mysql'  ));
$gacl = new gacl(array('db' => $global['db'], 'db_table_prefix' => 'gacl_'));
$gacl_api = new gacl_api(array('db' => $global['db'], 'db_table_prefix' => 'gacl_'));
$root_aro = $gacl_api->get_group_id('root', 'OpenEvSysUser', 'ARO');
//var_dump('root_aro' , $root_aro); exit(0);
$root_axo = $gacl_api->get_group_id('root', 'root', 'AXO');
//var_dump($root_axo);
$g_person = $gacl_api->add_group('person', 'Person', $root_axo, 'AXO');
$gacl_api->add_object_section('Person', 'person', 3, 0, 'AXO');
$gacl_api->add_acl(array('access' => array('access')), null, array($root_aro), null, array($g_person));
$persons = Browse::getPersonConf();
//var_dump($persons); exit(0);
foreach ($persons as $person) {
    acl_add_person($person['person_record_number']);
    //if event is marked as confidential limit it to this user and admin.
    if ($person['confidentiality'] == 'y') {
        acl_set_person_permissions($person['person_record_number']);
    }
}
 public function act_update_person_perms()
 {
     $persons = Browse::getPersonConf();
     //var_dump($persons); exit(0);
     foreach ($persons as $person) {
         acl_add_person($person['person_record_number']);
         //if event is marked as confidential limit it to this user and admin.
         if ($person['confidentiality'] == 'y') {
             acl_set_person_permissions($person['person_record_number']);
         }
     }
 }