да парсер у меня есть))
пока решил отложить, подумать
на скорую руку накатал что то типа
<?php
/*
* Created by: ramzes
* Date: 16.07.12
* Time: 15:18
* Only from SimpleCoreTPL Project
* All right reserved.
*/
class access
{
private $module = false;
private $acces = false;
private $user_id = false;
private $ini = false;
public function __construct($sql=false){
if($sql==false){
global $sql;
}
if(AUT){
$this->user_id = UID;
}
$this->ini = new ini('tmp/access.dat');
}
public function set_module($module){
$this->module = $module;
}
public function create_access($data_array){
$this->ini->_createSection($this->valid_name_object($data_array['object']), $data_array);
return true;
}
public function get_object($id){
$id = $this->valid_name_object($id);
return $this->ini->_getSection($id);
}
function list_object(){
return $this->ini->_getAll();
}
public function valid_name_object($name){
return str_replace('/', '____', str_replace('.php', '', $name));
}
}
class user_access{
private $user_id = false;
private $user_access = array();
private $ini;
public function __construct($id=false){
$this->user_id = ($id!=false) ? $id : UID;
$this->ini = new ini('tmp/user_access.dat');
if($this->user_access = $this->ini->_getSection($this->user_id)){
}else{
$this->ini->_createSection($this->user_id, array('user_id' => $this->user_id));
$this->user_access = $this->ini->_getSection($this->user_id);
}
$this->ini->_section($this->user_id);
}
public function get_current_access($object){
$object = $this->valid_name_object($object);
return ($this->ini->_get($object)!=0) ? true : false;
}
public function set_user_access($object, $access_level=1){
$object = $this->valid_name_object($object);
$this->ini->_set($object, $access_level);
}
public function valid_name_object($name){
return str_replace('/', '____', str_replace('.php', '', $name));
}
}