Beispiel #1
0
function system_info()
{
    $version = $GLOBALS['ext_version'];
    //$tab = extGetParam( $_REQUEST, 'tab', 'tab1' );
    $width = 400;
    // width of 100%
    ?>
	<br />
	<div id="sysinfo">
	<div id="system-page" class="x-tab" title="<?php 
    echo ext_Lang::msg('sisysteminfo');
    ?>
">
	
	<table class="adminform">
	<tr>
		<td valign="top" width="250" style="font-weight:bold;">
		Logged in as:
		</td>
		<td><?php 
    echo $_SESSION['s_user'];
    ?>
</td>
	<tr>
		<td valign="top" width="250" style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('sibuilton');
    ?>
:
		</td>
		<td>
		<?php 
    echo php_uname();
    ?>
		</td>
	</tr>
	<tr>
		<td valign="top" style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('siphpversion');
    ?>
:
		</td>
		<td>
		<?php 
    echo phpversion();
    ?>
		&nbsp;
		<?php 
    echo phpversion() >= '4.3' ? '' : $GLOBALS['messages']['siphpupdate'];
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('siwebserver');
    ?>
:
		</td>
		<td>
		<?php 
    echo get_server_software();
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('siwebsphpif');
    ?>
:
		</td>
		<td>
		<?php 
    echo php_sapi_name();
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('simamboversion');
    ?>
:
		</td>
		<td>
		<?php 
    echo $version;
    ?>
		</td>
	</tr>
	<tr>
		<td style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('siuseragent');
    ?>
:
		</td>
		<td>
		<?php 
    echo phpversion() <= "4.2.1" ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT'];
    ?>
		</td>
	</tr>
	<tr>
		<td valign="top" style="font-weight:bold;">
			<?php 
    echo ext_lang::msg('sirelevantsettings');
    ?>
:
		</td>
		<td>
			<table cellspacing="1" cellpadding="1" border="0">
			<tr>
				<td valign="top">
					<?php 
    echo ext_lang::msg('sisafemode');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('safe_mode', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sibasedir');
    ?>
:
				</td>
				<td>
				<?php 
    echo ($ob = ini_get('open_basedir')) ? $ob : 'none';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sidisplayerrors');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('display_errors');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sishortopentags');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('short_open_tag');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sifileuploads');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('file_uploads');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('simagicquotes');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('magic_quotes_gpc');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('siregglobals');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('register_globals', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sioutputbuf');
    ?>
:
				</td>
				<td>
				<?php 
    echo get_php_setting('output_buffering', 0);
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sisesssavepath');
    ?>
:
				</td>
				<td>
				<?php 
    echo ($sp = ini_get('session.save_path')) ? $sp : 'none';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sisessautostart');
    ?>
:
				</td>
				<td>
				<?php 
    echo intval(ini_get('session.auto_start'));
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sixmlenabled');
    ?>
:
				</td>
				<td>
					<?php 
    echo extension_loaded('xml') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sizlibenabled');
    ?>
:
				</td>
				<td>
				<?php 
    echo extension_loaded('zlib') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo ext_lang::msg('sidisabledfuncs');
    ?>
:
				</td>
				<td>
				<?php 
    echo ($df = ini_get('disable_functions')) ? $df : 'none';
    ?>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>
	</div>
	<div id="php-page" class="x-tab" title="<?php 
    echo ext_Lang::msg('siphpinfo');
    ?>
">
	<table class="adminform">
	<tr>
		<th colspan="2">
			<?php 
    echo ext_lang::msg('siphpinformation');
    ?>
:
		</th>
	</tr>
	<tr>
		<td>
		<?php 
    ob_start();
    phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
    $phpinfo = ob_get_contents();
    ob_end_clean();
    preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
    $output = preg_replace('#<table#', '<table class="adminlist" align="center"', $output[1][0]);
    $output = preg_replace('#(\\w),(\\w)#', '\\1, \\2', $output);
    $output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="4" width="95%"', $output);
    $output = preg_replace('#<hr />#', '', $output);
    echo $output;
    ?>
		</td>
	</tr>
	</table>
	</div>
	</div>
	<script type="text/javascript">
<!--
var tabs = new Ext.TabPanel( "sysinfo" );
tabs.addTab( "system-page","<?php 
    echo ext_Lang::msg('sisysteminfo');
    ?>
" ); 
tabs.addTab( "php-page","<?php 
    echo ext_Lang::msg('siphpinfo');
    ?>
" ); 
tabs.activate( "system-page" );
//-->
</script>
	<?php 
}
Beispiel #2
0
function system_info()
{
    $version = $GLOBALS['ext_version'];
    //$tab = extGetParam( $_REQUEST, 'tab', 'tab1' );
    $width = 400;
    // width of 100%
    switch (extGetParam($GLOBALS['__POST'], 'action2', 'panel')) {
        case 'systeminfo':
            ?>
		<div class="body-wrap">
		  <table class="member-table">
			<tr>
				<td valign="top" width="250" style="font-weight:bold;">
				Logged in as:
				</td>
				<td><?php 
            echo $_SESSION['credentials_extplorer']['username'];
            ?>
</td>
			<tr>
				<td valign="top" width="250" style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('sibuilton');
            ?>
:
				</td>
				<td>
				<?php 
            echo php_uname();
            ?>
				</td>
			</tr>
			<tr>
				<td valign="top" style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('siphpversion');
            ?>
:
				</td>
				<td>
				<?php 
            echo phpversion();
            ?>
				&nbsp;
				<?php 
            echo phpversion() >= '4.3' ? '' : $GLOBALS['messages']['siphpupdate'];
            ?>
				</td>
			</tr>
			<tr>
				<td style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('siwebserver');
            ?>
:
				</td>
				<td>
				<?php 
            echo get_server_software();
            ?>
				</td>
			</tr>
			<tr>
				<td style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('siwebsphpif');
            ?>
:
				</td>
				<td>
				<?php 
            echo php_sapi_name();
            ?>
				</td>
			</tr>
			<tr>
				<td style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('simamboversion');
            ?>
:
				</td>
				<td>
				<?php 
            echo $version;
            ?>
				</td>
			</tr>
			<tr>
				<td style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('siuseragent');
            ?>
:
				</td>
				<td>
				<?php 
            echo phpversion() <= "4.2.1" ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT'];
            ?>
				</td>
			</tr>
			<tr>
				<td valign="top" style="font-weight:bold;">
					<?php 
            echo ext_lang::msg('sirelevantsettings');
            ?>
:
				</td>
				<td>
					<table cellspacing="1" cellpadding="1" border="0">
					<tr>
						<td valign="top">
							<?php 
            echo ext_lang::msg('sisafemode');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('safe_mode', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sibasedir');
            ?>
:
						</td>
						<td>
						<?php 
            echo ($ob = ini_get('open_basedir')) ? $ob : 'none';
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sidisplayerrors');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('display_errors', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sishortopentags');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('short_open_tag', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sifileuploads');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('file_uploads');
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('simagicquotes');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('magic_quotes_gpc');
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('siregglobals');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('register_globals', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sioutputbuf');
            ?>
:
						</td>
						<td>
						<?php 
            echo get_php_setting('output_buffering', 0);
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sisesssavepath');
            ?>
:
						</td>
						<td>
						<?php 
            echo ($sp = ini_get('session.save_path')) ? $sp : 'none';
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sisessautostart');
            ?>
:
						</td>
						<td>
						<?php 
            echo intval(ini_get('session.auto_start'));
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sixmlenabled');
            ?>
:
						</td>
						<td>
							<?php 
            echo extension_loaded('xml') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sizlibenabled');
            ?>
:
						</td>
						<td>
						<?php 
            echo extension_loaded('zlib') ? '<font style="color: green;">' . $GLOBALS['messages']['miscyesno'][0] . '</font>' : '<font style="color: red;">' . $GLOBALS['messages']['miscyesno'][1] . '</font>';
            ?>
						</td>
					</tr>
					<tr>
						<td>
							<?php 
            echo ext_lang::msg('sidisabledfuncs');
            ?>
:
						</td>
						<td>
						<?php 
            echo ($df = ini_get('disable_functions')) ? $df : 'none';
            ?>
						</td>
					</tr>
					</table>
				</td>
			</tr>
			</table>
		</div>
			<?php 
            break;
        case 'phpinfo':
            ob_start();
            phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
            $phpinfo = ob_get_contents();
            ob_end_clean();
            preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
            $output = preg_replace('#<table#', '<table class="member-table" align="center"', $output[1][0]);
            $output = '<div class="body-wrap">' . $output . '</div>';
            $output = preg_replace('#(\\w),(\\w)#', '\\1, \\2', $output);
            $output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="4" width="95%"', $output);
            $output = preg_replace('#<hr />#', '', $output);
            echo $output;
            break;
        case 'about':
            show_about();
            break;
        default:
            ?>
			{
				"xtype": "tabpanel",
				
				"height": 350,
				"activeTab": 0,
				"items": [{
					"title": "<?php 
            echo ext_Lang::msg('aboutlink');
            ?>
",
					"autoScroll": true,
					"autoLoad": { 
						"url": "<?php 
            echo $GLOBALS['script_name'];
            ?>
",
						"params": {
							"option": "com_extplorer",
							"action": "get_about",
							"action2": "about"
						}
					}
				},{
					"title": "<?php 
            echo ext_Lang::msg('sisysteminfo');
            ?>
",
					"autoScroll": true,
					"autoLoad": { 
						"url": "<?php 
            echo $GLOBALS['script_name'];
            ?>
",
						"params": {
							"option": "com_extplorer",
							"action": "get_about",
							"action2": "systeminfo"
						}
					}
				},{
					"title": "<?php 
            echo ext_Lang::msg('siphpinfo');
            ?>
",
					"autoScroll": true,
					"autoLoad": { 
						"url": "<?php 
            echo $GLOBALS['script_name'];
            ?>
",
						"params": {
							"option": "com_extplorer",
							"action": "get_about",
							"action2": "phpinfo"
						}
					}
				}]
			}
			<?php 
    }
}
Beispiel #3
0
function show_userform($data = null)
{
    if ($data == null) {
        $data = array('', '', '', '', '', '', '');
    }
    ?>
	<div>
	    <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
	    <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
	
	        <h3 style="margin-bottom:5px;"><?php 
    if (!empty($data[0])) {
        echo $GLOBALS["messages"]["actadmin"] . ": " . sprintf($GLOBALS["messages"]["miscedituser"], $data[0]);
    } else {
        echo $GLOBALS["messages"]["actadmin"] . ": " . $GLOBALS["messages"]["miscadduser"];
    }
    ?>
</h3>
	        <div id="adminForm">
	
	        </div>
	    </div></div></div>
	    <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
	</div>
	<script type="text/javascript">
	var yesno = new Ext.data.SimpleStore({
	    fields: ['yesno', 'Yes_No'],
	    data :  [
	        ['1', '<?php 
    echo ext_Lang::msg(array('miscyesno' => 0), true);
    ?>
'],
	        ['0', '<?php 
    echo ext_Lang::msg(array('miscyesno' => 1), true);
    ?>
']
	        ]
	});
	var permvalues = new Ext.data.SimpleStore({
		fields: ['value', 'text'],
		data: [
	
	<?php 
    $permvalues = array(0, 1, 2, 3, 7);
    $permcount = count($GLOBALS["messages"]["miscpermnames"]);
    for ($i = 0; $i < $permcount; ++$i) {
        if ($permvalues[$i] == 7) {
            $index = 4;
        } else {
            $index = $i;
        }
        echo "['{$permvalues[$i]}', '" . ext_lang::msg(array('miscpermnames' => $index)) . "' ]\n";
        if ($i + 1 < $permcount) {
            echo ',';
        }
    }
    ?>
	]});
	var userform = new Ext.form.Form({
	    labelWidth: 125, // label settings here cascade unless overridden
	    url:'<?php 
    echo basename($GLOBALS['script_name']);
    ?>
'
	});

	
	userform.add(
	    new Ext.form.TextField({
	        fieldLabel: '<?php 
    echo ext_Lang::msg('miscusername', true);
    ?>
',
	        name: 'nuser',
	        value: '<?php 
    echo @$data[0];
    ?>
',
	        width:175,
	        allowBlank:false
	    }),
	    new Ext.form.TextField({
	        fieldLabel: '<?php 
    echo ext_Lang::msg('miscconfpass', true);
    ?>
',
	        name: 'pass1',
	        inputType: 'password',
	        width:175
	    }),
	    new Ext.form.TextField({
	        fieldLabel: '<?php 
    echo ext_Lang::msg('miscconfnewpass', true);
    ?>
',
	        name: 'pass2',
	        inputType: 'password',
	        width:175
	    }),
	    <?php 
    if (!empty($data[0])) {
        ?>
		    new Ext.form.Checkbox({
		        fieldLabel: '<?php 
        echo ext_Lang::msg('miscchpass', true);
        ?>
',
		        name: 'chpass',
		        hiddenValue: 'true'
			}),
			<?php 
    }
    ?>
	    
	    new Ext.form.TextField({
	        fieldLabel: '<?php 
    echo ext_Lang::msg('mischomedir', true);
    ?>
',
	        name: 'home_dir',
	        value: '<?php 
    echo !empty($data[2]) ? $data[2] : $_SERVER['DOCUMENT_ROOT'];
    ?>
',
	        width:175,
	        allowBlank:false
	    }),	    
	    new Ext.form.TextField({
	        fieldLabel: '<?php 
    echo ext_Lang::msg('mischomeurl', true);
    ?>
',
	        name: 'home_url',
	        value: '<?php 
    echo !empty($data[3]) ? $data[3] : $GLOBALS["home_url"];
    ?>
',
	        width:175,
	        allowBlank:false
	    }),		
		new Ext.form.ComboBox({
			fieldLabel: '<?php 
    echo ext_Lang::msg('miscshowhidden', true);
    ?>
',
		    store: yesno,
		    displayField:'Yes_No',
		    valueField: 'yesno',
		    hiddenName: 'show_hidden',
		    disableKeyFilter: true,
		    value: '<?php 
    echo !empty($data[4]) ? $data[4] : (int) $data[4];
    ?>
',
		    editable: false,
		    triggerAction: 'all',
		    mode: 'local',
		    allowBlank: false,
		    selectOnFocus:true
		}),
	    new Ext.form.TextField({
	        fieldLabel: '<?php 
    echo ext_Lang::msg('mischidepattern', true);
    ?>
',
	        name: 'no_access',
	        value: '<?php 
    echo @$data[5];
    ?>
',
	        width:175,
	        allowBlank:true
	    }),
	
		new Ext.form.ComboBox({
			fieldLabel: '<?php 
    echo ext_Lang::msg('miscperms', true);
    ?>
',
		    store: permvalues,
		    valueField: 'value',
		    displayField:'text',
		    hiddenName: 'permissions',
		    disableKeyFilter: true,
		    value: '<?php 
    echo (int) @$data[6];
    ?>
',
		    editable: false,
		    triggerAction: 'all',
		    mode: 'local'
		}),
		new Ext.form.ComboBox({
			fieldLabel: '<?php 
    echo ext_Lang::msg('miscactive', true);
    ?>
',
		    store: yesno,
		    displayField:'Yes_No',
		    valueField: 'yesno',
		    hiddenName: 'active',
		    disableKeyFilter: true,
		    value: '<?php 
    echo !empty($data[7]) ? $data[7] : 0;
    ?>
',
		    disabled: <?php 
    echo !empty($self) ? 'true' : 'false';
    ?>
,
		    editable: false,
		    triggerAction: 'all',
		    mode: 'local',
		    allowBlank: false,
		    selectOnFocus:true
		})
	);
	userform.addButton('<?php 
    echo ext_Lang::msg('btnsave', true);
    ?>
', function() {
		if( !check_pwd()) return;
		statusBarMessage( 'Please wait...', true );
	    userform.submit({
	        success: function(form, action) {	
	        	statusBarMessage( action.result.message, false, true );
				dialog_panel.load({ url: '<?php 
    echo make_link('admin', '');
    ?>
' });
	        },
	        failure: function(form, action) {
	        	if( !action.result ) return;
				Ext.MessageBox.alert('Error!', action.result.error);
				statusBarMessage( action.result.error, false, true );
	        },
	        scope: userform,
	        // add some vars to the request, similar to hidden fields
	        params: {option: 'com_extplorer', 
	        		user: '******',
	        		action: 'admin', 
	        		action2: '<?php 
    echo @$data[0] ? 'edituser' : 'adduser';
    ?>
',
	        		confirm: 'true'
	        }
	    })
	});
	userform.addButton('<?php 
    echo ext_Lang::msg('btncancel', true);
    ?>
', 
		function() { 
			dialog_panel.load({ url: '<?php 
    echo make_link('admin', '');
    ?>
' });
		} 
	);
	userform.render('adminForm');
	</script>
	<?php 
}
Beispiel #4
0
function show_userform($data = null)
{
    if ($data == null) {
        $data = array('', '', '', '', '', '', '');
    }
    $formname = @$data[0] ? 'frmedituser' : 'frmadduser';
    ?>
{
	"xtype": "form",
	"id" : "<?php 
    echo $formname;
    ?>
",
	"renderTo": Ext.getCmp("dialog_tabpanel").getEl(),
	"hidden": true,
	"closable":true,
	"autoHeight": "true",
	"labelWidth": 125,
	"url":"<?php 
    echo basename($GLOBALS['script_name']);
    ?>
",
	"title": "<?php 
    if (!empty($data[0])) {
        printf($GLOBALS["messages"]["miscedituser"], $data[0]);
    } else {
        echo $GLOBALS["messages"]["miscadduser"];
    }
    ?>
"	,
		
	items: [{
			"xtype": "textfield",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('miscusername', true);
    ?>
",
			"name": "nuser",
			"value": "<?php 
    echo @$data[0];
    ?>
",
			"width":175,
			"allowBlank":false
		},{
			"xtype": "textfield",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('miscconfpass', true);
    ?>
",
			"name": "pass1",
			"inputType": "password",
			"width":175
		},
		{	"xtype": "textfield",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('miscconfnewpass', true);
    ?>
",
			"name": "pass2",
			"inputType": "password",
			"width":175
		},
		<?php 
    if (!empty($data[0])) {
        ?>
			{	"xtype": "checkbox",
				"fieldLabel": "<?php 
        echo ext_Lang::msg('miscchpass', true);
        ?>
",
				"name": "chpass",
				"hiddenValue": "true"
			},
			<?php 
    }
    ?>
		{
			"xtype": "textfield",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('mischomedir', true);
    ?>
",
			"name": "home_dir",
			"value": "<?php 
    echo !empty($data[2]) ? $data[2] : $_SERVER['DOCUMENT_ROOT'];
    ?>
",
			"width":175,
			"allowBlank":false
		},
		{ 	"xtype": "textfield",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('mischomeurl', true);
    ?>
",
			"name": "home_url",
			"value": "<?php 
    echo !empty($data[3]) ? $data[3] : $GLOBALS["home_url"];
    ?>
",
			"width":175,
			"allowBlank":false
		},{
			"xtype": "combo",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('miscshowhidden', true);
    ?>
",
			"store": [
					["1", "<?php 
    echo ext_Lang::msg(array('miscyesno' => 0), true);
    ?>
"],
					["0", "<?php 
    echo ext_Lang::msg(array('miscyesno' => 1), true);
    ?>
"]
				   ],
			"hiddenName": "show_hidden",
			"disableKeyFilter": true,
			"value": "<?php 
    echo !empty($data[4]) ? $data[4] : (int) $data[4];
    ?>
",
			"editable": false,
			"triggerAction": "all",
			"mode": "local",
			"allowBlank": false,
			"selectOnFocus":true
		},
		{ 	"xtype": "textfield",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('mischidepattern', true);
    ?>
",
			"name": "no_access",
			"value": "<?php 
    echo @$data[5];
    ?>
",
			"width":175,
			"allowBlank":true
		},
		{
			"xtype": "combo",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('miscperms', true);
    ?>
",
			"store": [<?php 
    $permvalues = array(0, 1, 2, 3, 7);
    $permcount = count($GLOBALS["messages"]["miscpermnames"]);
    for ($i = 0; $i < $permcount; ++$i) {
        if ($permvalues[$i] == 7) {
            $index = 4;
        } else {
            $index = $i;
        }
        echo '["' . $permvalues[$i] . '", "' . ext_lang::msg(array('miscpermnames' => $index)) . '" ]' . "\n";
        if ($i + 1 < $permcount) {
            echo ',';
        }
    }
    ?>
					],
			"hiddenName": "permissions",
			"disableKeyFilter": true,
			"value": "<?php 
    echo (int) @$data[6];
    ?>
",
			"editable": false,
			"triggerAction": "all",
			"mode": "local"
		},
		{ 	"xtype": "combo",
			"fieldLabel": "<?php 
    echo ext_Lang::msg('miscactive', true);
    ?>
",
			"store": [
					["1", "<?php 
    echo ext_Lang::msg(array('miscyesno' => 0), true);
    ?>
"],
					["0", "<?php 
    echo ext_Lang::msg(array('miscyesno' => 1), true);
    ?>
"]
				   ],
			"hiddenName": "active",
			"disableKeyFilter": true,
			"value": "<?php 
    echo !empty($data[7]) ? $data[7] : 0;
    ?>
",
			"disabled": <?php 
    echo !empty($self) ? 'true' : 'false';
    ?>
,
			"editable": false,
			"triggerAction": "all",
			"mode": "local",
			"allowBlank": false,
			"selectOnFocus":true
		}
	],
	
	"buttons": [ {
		"text": "<?php 
    echo ext_Lang::msg('btnsave', true);
    ?>
", 
		"handler": function() {
					userform = Ext.getCmp("<?php 
    echo $formname;
    ?>
").getForm();
					if(userform.findField('nuser').getValue()=="" || userform.findField('home_dir').getValue()=="") {
						Ext.Msg.alert('Status', "<?php 
    echo ext_Lang::err('miscfieldmissed', true);
    ?>
");
						return false;
					}
					if( userform.findField('chpass') ) {
						if(userform.findField('chpass').getValue() &&
							userform.findField('pass1').getValue() != userform.findField('pass2').getValue())
						{
							Ext.Msg.alert('Status', "<?php 
    echo ext_Lang::err('miscnopassmatch', true);
    ?>
");
							return false;
						}
					}
					statusBarMessage( 'Please wait...', true );
					userform.submit({
						"success": function(form, action) {
							statusBarMessage( action.result.message, false, true );
							Ext.getCmp("dialog_tabpanel").remove("<?php 
    echo $formname;
    ?>
");
						},
						"failure": function(form, action) {
							if( !action.result ) return;
							Ext.Msg.alert('Error!', action.result.error);
							statusBarMessage( action.result.error, false, true );
						},
						"scope": userform,
						// add some vars to the request, similar to hidden fields
						"params": {option: 'com_extplorer', 
								user: "******",
								"action": 'admin', 
								"action2": "<?php 
    echo @$data[0] ? 'edituser' : 'adduser';
    ?>
",
								"confirm": "true"
						}
					})
				}
	},{
		"text": "<?php 
    echo ext_Lang::msg('btncancel', true);
    ?>
", 
		"handler": function() { Ext.getCmp("dialog_tabpanel").remove("<?php 
    echo $formname;
    ?>
"); }
	}]
}
	<?php 
}
Beispiel #5
0
                region: "north",
                xtype: "locationbar",
                id: "locationbarcmp",
                height: 28
            	},
            	{
                region: "center",
                xtype: "tabpanel",
	            id: "mainpanel",
	            enableTabScroll: true,
	            activeTab: 0,
	            items: [{
					xtype: "editorgrid",
		        	region: "center",
		            title: "<?php 
echo ext_lang::msg("actdir", true);
?>
",
		            autoScroll:true,
		            collapsible: false,
		            closeOnTab: true,
		            id: "gridpanel",
		            ds: datastore,
		            cm: cm,
		           	tbar: gridtb,
		            bbar: gridbb,
		            ddGroup : 'TreeDD',
		            enableDragDrop: true,
		            selModel: new Ext.grid.RowSelectionModel({
		                		listeners: {
		        					'rowselect': { fn: handleRowClick },
Beispiel #6
0
    function execAction($dir)
    {
        if (($GLOBALS["permissions"] & 01) != 01) {
            ext_Result::sendResult('upload', false, ext_Lang::err('accessfunc'));
        }
        // Execute
        if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
            if (isset($GLOBALS['__FILES']['Filedata'])) {
                // Re-Map the flash-uploaded file with the name "Filedata" to the "userfile" array
                $GLOBALS['__FILES']['userfile'] = array('name' => array($GLOBALS['__FILES']['Filedata']['name']), 'tmp_name' => array($GLOBALS['__FILES']['Filedata']['tmp_name']), 'size' => array($GLOBALS['__FILES']['Filedata']['size']), 'type' => array($GLOBALS['__FILES']['Filedata']['type']), 'error' => array($GLOBALS['__FILES']['Filedata']['error']));
            }
            $cnt = count($GLOBALS['__FILES']['userfile']['name']);
            $err = false;
            $err_available = isset($GLOBALS['__FILES']['userfile']['error']);
            // upload files & check for errors
            for ($i = 0; $i < $cnt; $i++) {
                $errors[$i] = NULL;
                $tmp = $GLOBALS['__FILES']['userfile']['tmp_name'][$i];
                $items[$i] = stripslashes($GLOBALS['__FILES']['userfile']['name'][$i]);
                if ($err_available) {
                    $up_err = $GLOBALS['__FILES']['userfile']['error'][$i];
                } else {
                    $up_err = file_exists($tmp) ? 0 : 4;
                }
                $abs = get_abs_item($dir, $items[$i]);
                if ($items[$i] == "" || $up_err == 4) {
                    continue;
                }
                if ($up_err == 1 || $up_err == 2) {
                    $errors[$i] = ext_lang::err('miscfilesize');
                    $err = true;
                    continue;
                }
                if ($up_err == 3) {
                    $errors[$i] = ext_lang::err('miscfilepart');
                    $err = true;
                    continue;
                }
                if (!@is_uploaded_file($tmp)) {
                    $errors[$i] = ext_lang::err('uploadfile');
                    $err = true;
                    continue;
                }
                if (@file_exists($abs) && empty($_REQUEST['overwrite_files'])) {
                    $errors[$i] = ext_lang::err('itemdoesexist');
                    $err = true;
                    continue;
                }
                // Upload
                $ok = @$GLOBALS['ext_File']->move_uploaded_file($tmp, $abs);
                if ($ok === false || PEAR::isError($ok)) {
                    $errors[$i] = ext_lang::err('uploadfile');
                    if (PEAR::isError($ok)) {
                        $errors[$i] .= ' [' . $ok->getMessage() . ']';
                    }
                    $err = true;
                    continue;
                } else {
                    if (!ext_isFTPMode()) {
                        @$GLOBALS['ext_File']->chmod($abs, 0644);
                    }
                }
            }
            if ($err) {
                // there were errors
                $err_msg = "";
                for ($i = 0; $i < $cnt; $i++) {
                    if ($errors[$i] == NULL) {
                        continue;
                    }
                    $err_msg .= $items[$i] . " : " . $errors[$i] . "\n";
                }
                ext_Result::sendResult('upload', false, $err_msg);
            }
            ext_Result::sendResult('upload', true, ext_Lang::msg('upload_completed'));
            return;
        }
        ?>
{
	"xtype": "tabpanel",
	"stateId": "upload_tabpanel",
	"activeTab": "uploadform",
	"dialogtitle": "<?php 
        echo ext_Lang::msg('actupload');
        ?>
",		
	"stateful": "true",
	
	"stateEvents": ["tabchange"],
	"getState": function() { return {
					activeTab:this.items.indexOf(this.getActiveTab())
				};
	},
	"listeners": {	"resize": {
						"fn": function(panel) {	
							panel.items.each( function(item) { item.setHeight(500);return true } );								
						}
					}
					
	},
	"items": [

		{
			"xtype": "swfuploadpanel",
			"title": "<?php 
        echo Ext_Lang::msg('flashupload');
        ?>
",
			"height": "300",
			"id": "swfuploader", 
			viewConfig: {
        		forceFit: true
			},
			"listeners": {	"allUploadsComplete": {
								"fn": function(panel) {	
									datastore.reload();	
									panel.destroy();
									Ext.getCmp("dialog").destroy();
									statusBarMessage('<?php 
        echo ext_Lang::msg('upload_completed', true);
        ?>
', false );								
								}
							}
							
			},
			// Uploader Params				
			"upload_url": "<?php 
        echo _EXT_URL . '/uploadhandler.php';
        ?>
",
			"post_params": { 
				"<?php 
        echo session_name();
        ?>
": "<?php 
        echo session_id();
        ?>
",
				"<?php 
        echo get_cfg_var('session.name');
        ?>
": "<?php 
        echo session_id();
        ?>
",
				"session_name": "<?php 
        echo session_name();
        ?>
",
				"user_agent": "<?php 
        echo addslashes($_SERVER['HTTP_USER_AGENT']);
        ?>
",
				"option": "com_extplorer", 
				"action": "upload", 
				"dir": datastore.directory, 
				"requestType": "xmlhttprequest",
				"confirm": "true"
			},
			
<?php 
        if ($_SERVER['SERVER_NAME'] == 'localhost') {
            echo '"debug": "true",';
        }
        ?>
				
			"flash_url": "<?php 
        echo _EXT_URL;
        ?>
/scripts/extjs3-ext/ux.swfupload/swfupload.swf",
			"prevent_swf_caching": "false",
			"file_size_limit": "<?php 
        echo get_max_file_size();
        ?>
B",
			// Custom Params
			"single_file_select": false, // Set to true if you only want to select one file from the FileDialog.
			"confirm_delete": false, // This will prompt for removing files from queue.
			"remove_completed": false // Remove file from grid after uploaded.
		},
	{
		"xtype": "form",
		"autoScroll": "true",
		"autoHeight": "true",
		"id": "uploadform",
		"fileUpload": true,
		"labelWidth": 125,
		"url":"<?php 
        echo basename($GLOBALS['script_name']);
        ?>
",
		"title": "<?php 
        echo ext_Lang::msg('standardupload');
        ?>
",
		"tooltip": "<?php 
        echo ext_Lang::msg('max_file_size') . ' = <strong>' . get_max_file_size() / 1024 / 1024 . ' MB<\\/strong><br \\/>' . ext_Lang::msg('max_post_size') . ' = <strong>' . get_max_upload_limit() / 1024 / 1024 . ' MB<\\/strong><br \\/>';
        ?>
",
		"frame": true,
		"items": [
		{
			"xtype": "displayfield",
			"value": "<?php 
        echo ext_Lang::msg('max_file_size') . ' = <strong>' . get_max_file_size() / 1024 / 1024 . ' MB<\\/strong><br \\/>' . ext_Lang::msg('max_post_size') . ' = <strong>' . get_max_upload_limit() / 1024 / 1024 . ' MB<\\/strong><br \\/>';
        ?>
"
		},
		<?php 
        for ($i = 0; $i < 7; $i++) {
            echo '{
				"xtype": "fileuploadfield",
				"fieldLabel": "' . ext_Lang::msg('file', true) . ' ' . ($i + 1) . '",
				"id": "userfile' . $i . '",
				"name": "userfile[' . $i . ']",
				"width":275,
				"buttonOnly": false
			},';
        }
        ?>
		{	"xtype": "checkbox",
			"fieldLabel": "<?php 
        echo ext_Lang::msg('overwrite_files', true);
        ?>
",
			"name": "overwrite_files",
			"checked": true
		}],
		"buttons": [{
			"text": "<?php 
        echo ext_Lang::msg('btnsave', true);
        ?>
", 
			"handler": function() {
				statusBarMessage( '<?php 
        echo ext_Lang::msg('upload_processing', true);
        ?>
', true );
				form = Ext.getCmp("uploadform").getForm();
				form.submit({
					//reset: true,
					reset: false,
					success: function(form, action) {
						datastore.reload();
						statusBarMessage( action.result.message, false, true );
						Ext.getCmp("dialog").destroy();
					},
					failure: function(form, action) {
						if( !action.result ) return;
						Ext.MessageBox.alert('<?php 
        echo ext_Lang::err('error', true);
        ?>
', action.result.error);
						statusBarMessage( action.result.error, false, false );
					},
					"scope": form,
					// add some vars to the request, similar to hidden fields
					"params": {
						"option": "com_extplorer", 
						"action": "upload", 
						"dir": datastore.directory,
						"requestType": "xmlhttprequest",
						"confirm": "true"
					}
				});
			}
		}, {
			"text": "<?php 
        echo ext_Lang::msg('btncancel', true);
        ?>
", 
			"handler": function() { Ext.getCmp("dialog").destroy(); } 
		}]
	},
	{
	
		"xtype": "form",
		"id": "transferform",
		"url":"<?php 
        echo basename($GLOBALS['script_name']);
        ?>
",
		"hidden": "true",
		"title": "<?php 
        echo ext_Lang::msg('acttransfer');
        ?>
",
		"autoHeight": "true",
		"labelWidth": 225,
		"frame": true,
		"items": [
		<?php 
        for ($i = 0; $i < 7; $i++) {
            echo '{
					"xtype": "textfield",
					"fieldLabel": "' . ext_Lang::msg('url_to_file', true) . '",
					"name": "userfile[' . $i . ']",
					"width":275
				},';
        }
        ?>
			{	"xtype": "checkbox",
				"fieldLabel": "<?php 
        echo ext_Lang::msg('overwrite_files', true);
        ?>
",
				"name": "overwrite_files",
				"checked": true
			}
		],
		"buttons": [{
	
			"text": "<?php 
        echo ext_Lang::msg('btnsave', true);
        ?>
", 
			"handler": function() {
				statusBarMessage( '<?php 
        echo ext_Lang::msg('transfer_processing', true);
        ?>
', true );
				transfer = Ext.getCmp("transferform").getForm();
				transfer.submit({
					//reset: true,
					reset: false,
					success: function(form, action) {
						datastore.reload();
						statusBarMessage( action.result.message, false, true );
						Ext.getCmp("dialog").destroy();
					},
					failure: function(form, action) {
						if( !action.result ) return;
						Ext.MessageBox.alert('<?php 
        echo ext_Lang::err('error', true);
        ?>
', action.result.error);
						statusBarMessage( action.result.error, false, false );
					},
					scope: transfer,
					// add some vars to the request, similar to hidden fields
					params: {
						"option": "com_extplorer", 
						"action": "transfer", 
						"dir": datastore.directory,
						"confirm": 'true'
					}
				});
			}
		},{
			"text": "<?php 
        echo ext_Lang::msg('btncancel', true);
        ?>
", 
			"handler": function() { Ext.getCmp("dialog").destroy(); }
		}]
	}]
}

	<?php 
    }