index 097c7ccdc90f2030cdd4cbc0d35b5e28ba0ff126..3e18c076950cc0fd0c4a6fb101ed61ce09859008 100644 (file)
<?php
/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2003-2005 Cajus Pollmeier
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
class userinfo
$this->ip= $_SERVER['REMOTE_ADDR'];
/* Initialize ACL_CACHE */
- $_SESSION['ACL_CACHE']= array();
+ session::set('ACL_CACHE',array());
$this->reset_acl_cache();
}
public function reset_acl_cache()
{
/* Initialize ACL_CACHE */
- $_SESSION['ACL_CACHE']= array();
+ session::set('ACL_CACHE',array());
}
function loadACL()
function get_permissions($dn, $object, $attribute= "", $skip_write= FALSE)
{
/* Push cache answer? */
- if (isset($_SESSION['ACL_CACHE']["$dn+$object+$attribute"])){
+ $ACL_CACHE = &session::get('ACL_CACHE');
+ if (isset($ACL_CACHE["$dn+$object+$attribute"])){
/* Remove write if needed */
if ($skip_write){
- $ret = preg_replace('/w/', '', $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]);
+ $ret = preg_replace('/w/', '', $ACL_CACHE["$dn+$object+$attribute"]);
}else{
- $ret = $_SESSION['ACL_CACHE']["$dn+$object+$attribute"];
+ $ret = $ACL_CACHE["$dn+$object+$attribute"];
}
return($ret);
}
}
}
- $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]= $ret;
+ $ACL_CACHE["$dn+$object+$attribute"]= $ret;
/* Remove write if needed */
if ($skip_write){
function get_module_departments($module)
{
/* Use cached results if possilbe */
- if(isset($_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)])){
- return($_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)]);
+ $ACL_CACHE = session::get('ACL_CACHE');
+ if(isset($ACL_CACHE['MODULE_DEPARTMENTS'][serialize($module)])){
+ return($ACL_CACHE['MODULE_DEPARTMENTS'][serialize($module)]);
}
global $plist;
}
}
- $_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)] = $deps;
+ $ACL_CACHE = &session::get('ACL_CACHE');
+ $ACL_CACHE['MODULE_DEPARTMENTS'][serialize($module)] = $deps;
return ($deps);
}