forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bradymiller
committed
Feb 7, 2009
1 parent
9d33369
commit 0e5a758
Showing
400 changed files
with
80,944 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Mike Benoit <[email protected]> | ||
- Initial idea of completely configurable ACLs. | ||
Though I haven't seen anything similar available, I'm sure its out there. | ||
- Initial implementation | ||
- Initial Documentation |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Mike Benoit <[email protected]> | ||
Wrote initial "proof of concept" implementation, and maintains documentation & code base. | ||
|
||
Dan Cech <[email protected]> | ||
Implemented the MPTT code, '_group_' feature, and ACL checks in the test suite. | ||
|
||
Gordon Luk <[email protected]> | ||
Native ACL_Check module for Perl, and wrote comments for phpDocumentor. | ||
|
||
Ben Margolin <[email protected]> | ||
Caught and fixed several bugs. | ||
|
||
R. Kunoth <[email protected]> | ||
Caught and fixed several bugs. | ||
|
||
Karsten Dambekalns <[email protected]> | ||
Sent in several patches to fix PHP warnings, and helped with the documentation. | ||
|
||
Martino Piccinato <[email protected]> | ||
Modified several API functions to help keep data in sync across tables. | ||
|
||
Paul Munn <[email protected]> | ||
Sent in Postgres7 table schema, plus some very good suggestions. As well helped with the documentation. | ||
|
||
Fred Cohen <[email protected]> | ||
Sent in Oracle 8i table schema. | ||
|
||
Eric Batchelor | ||
Always there to bounce ideas off of, he has consistently helped me out in many areas, including testing. | ||
|
||
Monte Ohrt <[email protected]> | ||
Andrei Zmievski <[email protected]> | ||
Together they made the best template engine available for PHP. Awesome job. | ||
|
||
John Lim <[email protected]> | ||
Author of ADODB, also the best database abstraction layer for PHP. | ||
|
||
Rasmus Lerdorf <[email protected]> | ||
For starting what eventually became the coolest programming language ever. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
<?php | ||
/* | ||
* phpGACL - Generic Access Control List - Hashed Directory Caching. | ||
* Copyright (C) 2002 Mike Benoit | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library 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 | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* For questions, help, comments, discussion, etc., please join the | ||
* phpGACL mailing list. http:https://sourceforge.net/mail/?group_id=57103 | ||
* | ||
* You may contact the author of phpGACL by e-mail at: | ||
* [email protected] | ||
* | ||
* The latest version of phpGACL can be obtained from: | ||
* http:https://phpgacl.sourceforge.net/ | ||
* | ||
*/ | ||
|
||
if ( !class_exists('Cache_Lite') ) { | ||
require_once(dirname(__FILE__) .'/Lite.php'); | ||
} | ||
|
||
define('DIR_SEP',DIRECTORY_SEPARATOR); | ||
|
||
class Hashed_Cache_Lite extends Cache_Lite | ||
{ | ||
/** | ||
* Make a file name (with path) | ||
* | ||
* @param string $id cache id | ||
* @param string $group name of the group | ||
* @access private | ||
*/ | ||
function _setFileName($id, $group) | ||
{ | ||
// CRC32 with SUBSTR is still faster then MD5. | ||
$encoded_id = substr(crc32($id),1); | ||
// $encoded_id = md5($id); | ||
|
||
// Generate just the directory, so it can be created. | ||
// Groups will have their own top level directory, for quick/easy purging of an entire group. | ||
$dir = $this->_cacheDir.$group.'/'.substr($encoded_id,0,3); | ||
$this->_create_dir_structure($dir); | ||
|
||
$this->_file = $dir.'/'.$encoded_id; | ||
} | ||
|
||
/** | ||
* Create full directory structure, Ripped straight from the Smarty Template engine. | ||
* Version: 2.3.0 | ||
* Copyright: 2001,2002 ispi of Lincoln, Inc. | ||
* | ||
* @param string $dir Full directory. | ||
* @access private | ||
*/ | ||
function _create_dir_structure($dir) | ||
{ | ||
if (!@file_exists($dir)) { | ||
$dir_parts = preg_split('![\/]+!', $dir, -1, PREG_SPLIT_NO_EMPTY); | ||
$new_dir = ($dir{0} == DIR_SEP) ? DIR_SEP : ''; | ||
foreach ($dir_parts as $dir_part) { | ||
$new_dir .= $dir_part; | ||
if (!file_exists($new_dir) && !mkdir($new_dir, 0771)) { | ||
Cache_Lite::raiseError('Cache_Lite : problem creating directory \"$dir\" !', -3); | ||
return false; | ||
} | ||
$new_dir .= DIR_SEP; | ||
} | ||
} | ||
} | ||
|
||
function _remove_dir_structure($dir,$remove_dir = false) | ||
{ | ||
if (in_array(substr($dir,-1),array(DIR_SEP,'/','\\'))) { | ||
$dir = substr($dir,0,-1); | ||
} | ||
|
||
if (!($dh = opendir($dir))) { | ||
$this->raiseError('Cache_Lite : Unable to open cache directory !', -4); | ||
return false; | ||
} | ||
|
||
while ($file = readdir($dh)) { | ||
if ($file == '.' || $file == '..') { | ||
continue; | ||
} | ||
$file = $dir . DIR_SEP . $file; | ||
if (is_dir($file)) { | ||
$this->_remove_dir_structure($file,true); | ||
continue; | ||
} | ||
if (is_file($file)) { | ||
if (!@unlink($file)) { | ||
closedir($dh); | ||
$this->raiseError('Cache_Lite : Unable to remove cache !', -3); | ||
return false; | ||
} | ||
continue; | ||
} | ||
} | ||
|
||
closedir($dh); | ||
|
||
if ($remove_dir) { | ||
clearstatcache(); | ||
if (!@rmdir($dir)) { | ||
$this->raiseError('Cache_Lite : Unable to remove cache directory !', -4); | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
/** | ||
* Clean the cache | ||
* | ||
* if no group is specified all cache files will be destroyed | ||
* else only cache files of the specified group will be destroyed | ||
* | ||
* @param string $group name of the cache group | ||
* @return boolean true if no problem | ||
* @access public | ||
*/ | ||
function clean($group = false) | ||
{ | ||
if ($group) { | ||
$motif = $this->_cacheDir.$group.'/'; | ||
|
||
if ($this->_memoryCaching) { | ||
foreach ($this->_memoryCachingArray as $key => $value) { | ||
if (strpos($key, $motif, 0)) { | ||
unset($this->_memoryCachingArray[$key]); | ||
} | ||
} | ||
$this->_memoryCachingCounter = count($this->_memoryCachingArray); | ||
if ($this->_onlyMemoryCaching) { | ||
return true; | ||
} | ||
} | ||
|
||
return $this->_remove_dir_structure($motif); | ||
} | ||
|
||
if ($this->_memoryCaching) { | ||
$this->_memoryCachingArray = array(); | ||
$this->_memoryCachingCounter = 0; | ||
if ($this->_onlyMemoryCaching) { | ||
return true; | ||
} | ||
} | ||
|
||
if (!($dh = opendir($this->_cacheDir))) { | ||
$this->raiseError('Cache_Lite : Unable to open cache directory !', -4); | ||
return false; | ||
} | ||
|
||
while ($file = readdir($dh)) { | ||
if ($file == '.' || $file == '..') { | ||
continue; | ||
} | ||
$file = $this->_cacheDir . $file; | ||
if (is_dir($file) && !$this->_remove_dir_structure($file,true)) { | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
} | ||
|
||
// end of script |
Oops, something went wrong.