00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00031 class edit_rights extends WebObject
00032 {
00033 function init()
00034 {
00035 $this->addSVar('user', USER);
00036 }
00037
00038 function onRender()
00039 {
00040 $rs = new EditableRS('edit_rights');
00041 $accr_path = ADMIN.'access_rights/';
00042 $user = $this->getSVar('user');
00043 $output = shell("find $accr_path -type f -name '$user'");
00044 $arr_files = explode("\n", $output);
00045 for ($i=0; $i < sizeof($arr_files); $i++)
00046 {
00047 $fname = $arr_files[$i];
00048 if ($fname=='') continue;
00049
00050 $rec = array(
00051 'book_id' => basename(dirname($fname)),
00052 'edit_rights' => trim(implode('', file($fname)))
00053 );
00054 $rs->addRec($rec);
00055 }
00056 global $webPage;
00057 $webPage->addRecordset($rs);
00058 }
00059 }
00060 ?>