Changeset 1909 for sandbox/filemanager/inc/class.uiconfig.inc.php
- Timestamp:
- 12/29/09 14:33:30 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.uiconfig.inc.php
r1905 r1909 19 19 'reconstructFolder' => True, 20 20 'set_owner' => True, 21 'set_permission' => True, 21 22 'renameFolder' => True, 22 23 'createFolder' => True, … … 81 82 $vars[lang_search]=lang('search'); 82 83 $vars[lang_directory]=lang('directory'); 83 $vars[lang_config]=lang('config'); 84 $vars[lang_setowner]=lang('set owner'); 85 $vars[lang_setperm]=lang('set permission'); 84 86 85 87 $t->set_var($vars); … … 288 290 echo "<option value='".$val['account_id']."'>".$val['account_lid']."</option>"; 289 291 } 292 function set_permission(){ 293 $GLOBALS['phpgw_info']['flags'] = array 294 ( 295 'currentapp' => 'filemanager', 296 'noheader' => True, 297 'nonavbar' => True, 298 'nofooter' => True, 299 'noappheader' => True, 300 'enable_browser_class' => True 301 ); 302 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir'])); 303 $perms = ($_GET['perms'])*1; 304 $owner = ($_GET['owner'])*1; 305 $dirs=explode('/',$name); 306 $GLOBALS['phpgw']->db->query('SELECT owner_id from phpgw_vfs WHERE directory = \'/'.$dirs[1].'\' and name=\''.$dirs[2].'\' LIMIT 1',__LINE__,__FILE__); 307 if ($GLOBALS['phpgw']->db->next_record()){ 308 $val = $GLOBALS['phpgw']->db->row(); 309 $owner_id = $val['owner_id']; 310 } 311 312 $query = "SELECT count(*) FROM phpgw_acl WHERE acl_appname = 'filemanager' and acl_account = '".$owner_id."' and acl_location='".$owner."'"; 313 if ($GLOBALS['phpgw']->db->query($query) && $GLOBALS['phpgw']->db->next_record()) 314 $val = $GLOBALS['phpgw']->db->row(); 315 else 316 { 317 echo $GLOBALS['phpgw']->db->error; 318 return false; 319 } 320 if ($val['count'] == '1') 321 $GLOBALS['phpgw']->db->query("UPDATE phpgw_acl SET acl_rights = ".$perms." where acl_appname = 'filemanager' and acl_account = '".$owner_id."' AND acl_location = '".$owner."'",__LINE__,__FILE__); 322 else 323 $GLOBALS['phpgw']->db->query("INSERT INTO phpgw_acl values('filemanager','".$owner."','".$owner_id."',".$perms.")",__LINE__,__FILE__); 324 if ($GLOBALS['phpgw']->db->Error) 325 echo "Erro"; 326 else 327 { 328 echo lang('entry updated sucessfully'); 329 } 330 return; 331 } 332 333 290 334 function set_owner(){ 291 335 $GLOBALS['phpgw_info']['flags'] = array
Note: See TracChangeset
for help on using the changeset viewer.