Changeset 1905 for sandbox/filemanager/inc/class.uiconfig.inc.php
- Timestamp:
- 12/29/09 10:14:51 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.uiconfig.inc.php
r1888 r1905 12 12 var $public_functions = array( 13 13 'search_dir' => True, 14 'search_user' => True, 14 15 'update_quota' => True, 15 16 'load_quota' => True, … … 17 18 'removeFolder' => True, 18 19 'reconstructFolder' => True, 20 'set_owner' => True, 19 21 'renameFolder' => True, 22 'createFolder' => True, 23 'groups_users' => True, 20 24 'folders' => True 21 25 ); … … 46 50 $vars[lang_remove]=lang('remove'); 47 51 $vars[lang_rename]=lang('rename'); 52 $vars[lang_create]=lang('create'); 48 53 $vars[lang_reconstruct]=lang('reconstruct'); 49 54 … … 54 59 55 60 } 61 function groups_users(){ 62 $GLOBALS['phpgw_info']['flags'] = array 63 ( 64 'currentapp' => 'filemanager', 65 'noheader' => False, 66 'nonavbar' => False, 67 'nofooter' => False, 68 'noappheader' => False, 69 'enable_browser_class' => True 70 ); 71 72 $GLOBALS['phpgw']->common->phpgw_header(); 73 include('load_lang.php'); 74 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>"; 75 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/common_functions.js'></script>"; 76 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/config.js'></script>"; 77 $t = $GLOBALS['phpgw']->template; 78 $t->set_file(array('config_list' => 'config_owner.tpl')); 79 $t->set_block('config_list','body','body'); 80 $vars[lang_users_and_groups]=lang('Users and groups'); 81 $vars[lang_search]=lang('search'); 82 $vars[lang_directory]=lang('directory'); 83 $vars[lang_config]=lang('config'); 84 85 $t->set_var($vars); 86 $t->pparse('out','body'); 87 $GLOBALS['phpgw']->common->phpgw_footer(); 88 $GLOBALS['phpgw']->common->phpgw_exit(); 89 90 } 91 92 function createFolder(){ 93 $GLOBALS['phpgw_info']['flags'] = array 94 ( 95 'currentapp' => 'filemanager', 96 'noheader' => True, 97 'nonavbar' => True, 98 'nofooter' => True, 99 'noappheader' => True, 100 'enable_browser_class' => True 101 ); 102 $bo = CreateObject('filemanager.bofilemanager'); 103 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['name'])); 104 if (strlen($name) < 2) 105 return false; 106 $c = CreateObject('phpgwapi.config','filemanager'); 107 $c->read_repository(); 108 $current_config = $c->config_data; 109 110 $bo->vfs->override_acl = 1; 111 112 if ( $bo->vfs->mkdir(array( 113 'string' => $name, 114 'relatives' => array(RELATIVE_NONE) 115 )) ) 116 if ( $bo->vfs->set_quota(array( 117 'string' => $name, 118 'relatives' => array(RELATIVE_NONE), 119 'new_quota' => $current_config['filemanager_quota_size'] 120 )) ) 121 $return = True; 122 123 $bo->vfs->override_acl = 0; 124 if ($return){ 125 echo "Folder created"; 126 } 127 else 128 echo "Error"; 129 } 130 56 131 function removeFolder(){ 57 132 $GLOBALS['phpgw_info']['flags'] = array … … 156 231 ); 157 232 158 233 $GLOBALS['phpgw']->common->phpgw_header(); 159 234 include('load_lang.php'); 160 235 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>"; … … 185 260 ); 186 261 $name = $GLOBALS['phpgw']->db->db_addslashes($_GET['name']); 187 $GLOBALS['phpgw']->db->query('SELECT DISTINCT directory FROM phpgw_vfs WHERE directory like \'%'.$name.'%\'LIMIT 20',__LINE__,__FILE__);262 $GLOBALS['phpgw']->db->query('SELECT DISTINCT directory FROM phpgw_vfs WHERE (directory like \'%'.$name.'%\') LIMIT 20',__LINE__,__FILE__); 188 263 while ($GLOBALS['phpgw']->db->next_record()){ 189 264 $val = $GLOBALS['phpgw']->db->row(); 190 265 echo "<option>".$val['directory']."</option>"; 191 266 } 192 } 267 $GLOBALS['phpgw']->db->query('SELECT directory,name from phpgw_vfs WHERE directory = \'/home\' and name like \'%'.$name.'%\' LIMIT 1',__LINE__,__FILE__); 268 if ($GLOBALS['phpgw']->db->next_record()){ 269 $val = $GLOBALS['phpgw']->db->row(); 270 echo "<option>".$val['directory']."/".$val['name']."</option>"; 271 } 272 273 274 } 275 function search_user(){ 276 $GLOBALS['phpgw_info']['flags'] = array 277 ( 278 'currentapp' => 'filemanager', 279 'noheader' => True, 280 'nonavbar' => True, 281 'nofooter' => True, 282 'noappheader' => True, 283 'enable_browser_class' => True 284 ); 285 $account_info = $GLOBALS['phpgw']->accounts->get_list('both',0,'','',$_GET['name'],'all'); 286 287 foreach($account_info as $val) 288 echo "<option value='".$val['account_id']."'>".$val['account_lid']."</option>"; 289 } 290 function set_owner(){ 291 $GLOBALS['phpgw_info']['flags'] = array 292 ( 293 'currentapp' => 'filemanager', 294 'noheader' => True, 295 'nonavbar' => True, 296 'nofooter' => True, 297 'noappheader' => True, 298 'enable_browser_class' => True 299 ); 300 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir'])); 301 $owner = ($_GET['owner'])*1; 302 303 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs SET owner_id = '.$owner.' WHERE directory = \''.$name.'\'',__LINE__,__FILE__); 304 if ($GLOBALS['phpgw']->db->Error) 305 echo "Erro"; 306 else 307 { 308 $dirs=explode('/',$name); 309 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs SET owner_id = '.$owner.' WHERE directory = \'/'.$dirs[1].'\' and name=\''.$dirs[2].'\'',__LINE__,__FILE__); 310 if ($GLOBALS['phpgw']->db->Error) 311 echo "Erro"; 312 else 313 { 314 echo lang('entry updated sucessfully'); 315 } 316 } 317 return; 318 } 319 193 320 function update_quota(){ 194 321 $GLOBALS['phpgw_info']['flags'] = array
Note: See TracChangeset
for help on using the changeset viewer.