Changeset 1905
- Timestamp:
- 12/29/09 10:14:51 (14 years ago)
- Location:
- sandbox/filemanager
- Files:
-
- 1 added
- 6 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 -
sandbox/filemanager/inc/class.uifilemanager.inc.php
r1889 r1905 408 408 } 409 409 410 $this->update_groups();411 $this->groups_applications = array();412 413 foreach ($this->readable_groups as $value)414 {415 $applications = CreateObject('phpgwapi.applications', $value['account_id']);416 $this->groups_applications[$value['account_name']] = $applications->read_account_specific();417 }418 419 410 /*Check permission*/ 420 411 if($this->bo->vfs->acl_check(array( … … 582 573 $this->groups_applications = array(); 583 574 575 $user_groups = $GLOBALS['phpgw']->accounts->membership(); 576 foreach($user_groups as $val){ 577 $account_name = $GLOBALS['phpgw']->accounts->id2name($val['account_id']); 578 $this->readable_groups[$account_name] = array( 579 'account_id' => $val['account_id'], 580 'account_name' => $account_name 581 ); 582 } 583 584 584 foreach ($this->readable_groups as $value) 585 585 { … … 625 625 else 626 626 $vars[tools_button] = ""; 627 628 /* $this->dirs=$this->all_other_directories();629 foreach($this->dirs as $dir)630 if((($dir['directory'] . $dir['name']) != $this->path) && $this->bo->vfs->file_exists(array('string' => $dir['directory'] . $dir['name'],'relatives' => array(RELATIVE_NONE))))631 {632 //FIXME replace the html_form_option function633 $dirs_options .= $this->html_form_option($dir['directory'] . $dir['name'], $dir['directory'] . $dir['name']);634 }635 $toolbar.='<select name="todir" style="visibility:hidden">'.$dirs_options.'</select>';*/636 627 637 628 $vars[toolbar1]=$toolbar; … … 1212 1203 while(list($num, $group_array) = each($this->readable_groups)) 1213 1204 { 1214 / *Don't list directories for groups that don't have access1205 // Don't list directories for groups that don't have access 1215 1206 if(!$this->groups_applications[$group_array['account_name']][$this->bo->appname]['enabled']) 1216 1207 { 1217 ]continue;1218 } */1208 continue; 1209 } 1219 1210 1220 1211 $dirs[] = array('directory' => $this->bo->fakebase, 'name' => $group_array['account_name']); -
sandbox/filemanager/inc/hook_admin.inc.php
r1787 r1905 27 27 'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname), 28 28 'Folders management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.folders'), 29 'Quota management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.quota') 29 'Quota management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.quota'), 30 'Groups and users' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.groups_users') 30 31 31 32 ); -
sandbox/filemanager/js/config.js
r1888 r1905 5 5 function load_quota(el){ 6 6 cExecute('/index.php?menuaction=filemanager.uiconfig.load_quota&name='+base64_encode(el.value),loadq_handler); 7 } 8 function set_owner(){ 9 var dirName = document.getElementById('search1').value; 10 var ownerName = document.getElementById('search2').value; 11 cExecute('/index.php?menuaction=filemanager.uiconfig.set_owner&dir='+base64_encode(dirName)+'&owner='+ownerName,alert); 7 12 } 8 13 function save_quota(){ … … 13 18 function dir_handler(data){ 14 19 document.getElementById('search1').innerHTML = data; 20 } 21 22 function user_handler(data){ 23 document.getElementById('search2').innerHTML = data; 15 24 } 16 25 var timeO; … … 27 36 } 28 37 } 29 38 function search_user(el){ 39 if (el.value.length < 4){ 40 document.getElementById('span_searching1').innerHTML = get_lang('Type at least 4 chars'); 41 } 42 else 43 { 44 document.getElementById('span_searching1').innerHTML = ''; 45 if (timeO) 46 clearTimeout(timeO); 47 timeO = setTimeout('cExecute(\'/index.php?menuaction=filemanager.uiconfig.search_user&name='+el.value+'\',user_handler)',700); 48 } 49 } 30 50 function delete_folder(){ 31 51 var dirName = document.getElementById('search1').value; … … 47 67 } 48 68 69 function create_folder(){ 70 var toName = prompt(get_lang('Enter the name of folder you want to create:'),'/home/'); 71 if (toName.length > 1){ 72 cExecute('/index.php?menuaction=filemanager.uiconfig.createFolder&name='+base64_encode(toName),alert); 73 } 74 } 75 49 76 function reconstruct_folder(){ 50 77 var dirName = document.getElementById('search1').value; -
sandbox/filemanager/templates/default/config.tpl
r1694 r1905 20 20 </tr> 21 21 <tr bgcolor="{row_on}"> 22 <td>{lang_antivirus_command}</td> 22 <td>{lang_antivirus_command}</td> 23 23 <td> 24 24 <input size="40" name="newsettings[filemanager_antivirus_command]" value="{value_filemanager_antivirus_command}"> -
sandbox/filemanager/templates/default/config_folders.tpl
r1888 r1905 24 24 <input onclick="reconstruct_folder()" type="button" value="{lang_reconstruct}" /> 25 25 <input onclick="rename_folder()" type="button" value="{lang_rename}" /> 26 <input onclick="create_folder()" type="button" value="{lang_create}" /> 26 27 </td> 27 28 <td>
Note: See TracChangeset
for help on using the changeset viewer.