file_exists( $abs_item )) { ext_Result::sendResult('chmod', false, $item.": ".$GLOBALS["error_msg"]["fileexist"]); } if(!get_show_item($dir, $item)) { ext_Result::sendResult('chmod', false, $item.": ".$GLOBALS["error_msg"]["accessfile"]); } if( $do_recurse ) { $ok = $GLOBALS['ext_File']->chmodRecursive( $abs_item, $mode ); } else { if( get_is_dir( $abs_item )) { // when we chmod a directory we must care for the permissions // to prevent that the directory becomes not readable (when the "execute bits" are removed) $bin = substr_replace( $bin, '1', 2, 1 ); // set 1st x bit to 1 $bin = substr_replace( $bin, '1', 5, 1 );// set 2nd x bit to 1 $bin = substr_replace( $bin, '1', 8, 1 );// set 3rd x bit to 1 if( ext_isFTPMode() ) { $mode = decoct(bindec($bin)); } else { $mode = bindec($bin); } } //ext_Result::sendResult('chmod', false, $GLOBALS['FTPCONNECTION']->pwd()); $ok = @$GLOBALS['ext_File']->chmod( $abs_item, $mode ); } $bin = $old_bin; } if($ok===false || PEAR::isError( $ok ) ) { $msg = $item.": ".$GLOBALS["error_msg"]["permchange"]; $msg .= PEAR::isError( $ok ) ? ' [' . $ok->getMessage().']' : ''; ext_Result::sendResult('chmod', false, $msg ); } ext_Result::sendResult('chmod', true, ext_Lang::msg('permchange') ); return; } if( ext_isFTPMode() ) { $abs_item = get_item_info( $dir, $GLOBALS['__POST']["selitems"][0]); } else { $abs_item = get_abs_item( $dir, $GLOBALS['__POST']["selitems"][0]); $abs_item = utf8_decode($abs_item); } $mode = parse_file_perms(get_file_perms( $abs_item )); if($mode===false) { ext_Result::sendResult('chmod', false, $item.": ".$GLOBALS["error_msg"]["permread"]); } $pos = "rwx"; $text = ""; for($i=0;$i<$cnt;++$i) { $s_item=get_rel_item($dir,$GLOBALS['__POST']["selitems"][$i]); if(strlen($s_item)>50) $s_item="...".substr($s_item,-47); $text .= $s_item.($i+1<$cnt ? ', ':''); } ?> { "xtype": "form", "id": "simpleform", "width": "300", "labelWidth": 125, "url":"", "dialogtitle": "", "title" : "", "frame": true, "items": [{ "layout": "column", "items": [{ "width":80, "title":" $i ), true ) ?>", "items": [{ "xtype": "checkbox", "boxLabel":"", "name":"" } ] } ,{ "width":400, "style":"margin-left:10px", "clear":true, "html": " " }] },{ "xtype": "checkbox", "fieldLabel":"", "name":"do_recurse" }], "buttons": [{ "text": "", "handler": function() { statusBarMessage( '', true ); form = Ext.getCmp("simpleform").getForm(); form.submit({ //reset: true, reset: false, success: function(form, action) { statusBarMessage( action.result.message, false, true ); datastore.reload(); Ext.getCmp("dialog").destroy(); }, failure: function(form, action) { statusBarMessage( action.result.error, false, false ); Ext.Msg.alert('', action.result.error); }, scope: form, params: { "option": "com_extplorer", "action": "chmod", "dir": "", "selitems[]": [''], confirm: 'true', token: "" } }); } },{ "text": "", "handler": function() { Ext.getCmp("dialog").destroy(); } }] }