本文整理汇总了PHP中ext_Lang::err方法的典型用法代码示例。如果您正苦于以下问题:PHP ext_Lang::err方法的具体用法?PHP ext_Lang::err怎么用?PHP ext_Lang::err使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ext_Lang
的用法示例。
在下文中一共展示了ext_Lang::err方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execAction
function execAction($dir, $item)
{
if (!ext_isArchive($item)) {
ext_Result::sendResult('archive', false, $item . ': ' . ext_Lang::err('extract_noarchive'));
} else {
// CSRF Security Check
if (!ext_checkToken($GLOBALS['__POST']["token"])) {
ext_Result::sendResult('tokencheck', false, 'Request failed: Security Token not valid.');
}
$archive_name = realpath(get_abs_item($dir, $item));
if (empty($dir)) {
$extract_dir = realpath($GLOBALS['home_dir']);
} else {
$extract_dir = realpath($GLOBALS['home_dir'] . "/" . $dir);
}
require_once _EXT_PATH . '/libraries/Archive/archive.php';
$res = extArchive::extract($archive_name, $extract_dir);
if (PEAR::isError($res)) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure') . ' - ' . $res->getMessage());
}
if ($res === false) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure'));
} else {
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
}
示例2: execAction
function execAction($dir, $item)
{
if (!ext_isArchive($item)) {
ext_Result::sendResult('archive', false, $item . ': ' . ext_Lang::err('extract_noarchive'));
} else {
$archive_name = realpath(get_abs_item($dir, $item));
if (empty($dir)) {
$extract_dir = realpath($GLOBALS['home_dir']);
} else {
$extract_dir = realpath($GLOBALS['home_dir'] . "/" . $dir);
}
require_once _EXT_PATH . '/libraries/Archive/archive.php';
$res = extArchive::extract($archive_name, $extract_dir);
if (PEAR::isError($res)) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure') . ' - ' . $res->getMessage());
}
if ($res === false) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure'));
} else {
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
}
示例3: onShowLoginForm
function onShowLoginForm($User, $Pass)
{
?>
{
xtype: "form",
<?php
if (!ext_isXHR()) {
?>
renderTo: "adminForm", <?php
}
?>
title: "<?php
echo ext_Lang::msg('actlogin');
?>
",
id: "simpleform",
labelWidth: 125, // label settings here cascade unless overridden
url: "<?php
echo basename($GLOBALS['script_name']);
?>
",
frame: true,
keys: {
key: Ext.EventObject.ENTER,
fn : function(){
if (simple.getForm().isValid()) {
Ext.get( "statusBar").update( "Please wait..." );
Ext.getCmp("simpleform").getForm().submit({
reset: false,
success: function(form, action) { location.reload() },
failure: function(form, action) {
if( !action.result ) return;
Ext.Msg.alert('<?php
echo ext_Lang::err('error', true);
?>
', action.result.error, function() {
this.findField( 'password').setValue('');
this.findField( 'password').focus();
}, form );
Ext.get( 'statusBar').update( action.result.error );
},
scope: Ext.getCmp("simpleform").getForm(),
params: {
option: "com_extplorer",
action: "login",
type : "extplorer"
}
});
} else {
return false;
}
}
},
items: [{
xtype:"textfield",
fieldLabel: "<?php
echo ext_Lang::msg('miscusername', true);
?>
",
name: "username",
value: "<?php
echo $User;
?>
",
width:175,
allowBlank:false
},{
xtype:"textfield",
fieldLabel: "<?php
echo ext_Lang::msg('miscpassword', true);
?>
",
name: "password",
value: "<?php
echo $Pass;
?>
",
inputType: "password",
width:175,
allowBlank:false
}, new Ext.form.ComboBox({
fieldLabel: "<?php
echo ext_Lang::msg('misclang', true);
?>
",
store: new Ext.data.SimpleStore({
fields: ['language', 'langname'],
data : [
<?php
$langs = get_languages();
$i = 0;
$c = count($langs);
foreach ($langs as $language => $name) {
echo "['{$language}', '{$name}' ]";
if (++$i < $c) {
echo ',';
}
}
?>
//.........这里部分代码省略.........
示例4: execAction
function execAction()
{
$ftp_login = extGetParam($_POST, 'ftp_login_name', '');
$ftp_pass = extGetParam($_POST, 'ftp_login_pass', '');
global $dir, $mosConfig_live_site;
if ($ftp_login != '' || $ftp_pass != '') {
$ftp_host = extGetParam($_POST, 'ftp_hostname_port', 'localhost:21');
$url = @parse_url('ftp://' . $ftp_host);
if (empty($url)) {
ext_Result::sendResult('ftp_authentication', false, 'Unable to parse the specified Host Name. Please use a hostname in this format: hostname:21');
}
$port = empty($url['port']) ? 21 : $url['port'];
$ftp = new Net_FTP($url['host'], $port, 20);
$res = $ftp->connect();
if (PEAR::isError($res)) {
ext_Result::sendResult('ftp_authentication', false, $GLOBALS['messages']['ftp_connection_failed'] . ' (' . $url['host'] . ')');
} else {
$res = $ftp->login($ftp_login, $ftp_pass);
$ftp->disconnect();
if (PEAR::isError($res)) {
ext_Result::sendResult('ftp_authentication', false, $GLOBALS['messages']['ftp_login_failed']);
}
$_SESSION['ftp_login'] = $ftp_login;
$_SESSION['ftp_pass'] = $ftp_pass;
$_SESSION['ftp_host'] = $ftp_host;
$_SESSION['file_mode'] = 'ftp';
session_write_close();
ext_Result::sendResult('ftp_authentication', true, ext_Lang::msg('actlogin_success'));
}
} else {
?>
<div style="width:auto;">
<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
echo $GLOBALS["messages"]["ftp_header"];
?>
</h3>
<strong><?php
echo $GLOBALS["messages"]["ftp_login_lbl"];
?>
</strong><br />
<br />
<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 simple = new Ext.form.Form({
labelWidth: 175, // label settings here cascade unless overridden
url:'<?php
echo make_link("rename", $dir, $item);
?>
'
});
simple.add(
new Ext.form.TextField({
fieldLabel: '<?php
echo ext_Lang::msg('ftp_login_name', true);
?>
',
name: 'ftp_login_name',
width:175,
allowBlank:false
}),
new Ext.form.TextField({
fieldLabel: '<?php
echo ext_Lang::msg('ftp_login_pass', true);
?>
',
name: 'ftp_login_pass',
inputType: 'password',
width:175,
allowBlank:false
}),
new Ext.form.TextField({
fieldLabel: '<?php
echo ext_Lang::msg('ftp_hostname_port', true);
?>
',
name: 'ftp_hostname_port',
value: '<?php
echo extGetParam($_SESSION, 'ftp_host', 'localhost:21');
?>
',
width:175,
allowBlank:false
})
);
simple.addButton({text: '<?php
echo ext_Lang::msg('btnlogin', true);
?>
', type: 'submit' }, function() {
statusBarMessage( '<?php
echo ext_Lang::msg('ftp_login_check', true);
?>
//.........这里部分代码省略.........
示例5: admin
function admin($admin, $dir)
{
// Change Password & Manage Users Form
// Javascript functions:
include _EXT_PATH . "/include/js_admin.php";
?>
<div style="width:auto;">
<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
echo ext_Lang::msg('actadmin');
?>
</h3>
<div id="adminForm">
<div id="passForm"></div>
<div id="userList"></div>
</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">
// Change Password
var PassForm = new Ext.form.Form({
labelWidth: 125, // label settings here cascade unless overridden
url:'<?php
echo basename($GLOBALS['script_name']);
?>
'
});
PassForm.add(
new Ext.form.TextField({
fieldLabel: '<?php
echo ext_Lang::msg('miscoldpass', true);
?>
',
name: 'oldpwd',
inputType: 'password',
allowBlank:false
}),
new Ext.form.TextField({
fieldLabel: '<?php
echo ext_Lang::msg('miscnewpass', true);
?>
',
name: 'newpwd1',
hiddenName: 'newpwd1',
inputType: 'password',
allowBlank:false
}),
new Ext.form.TextField({
fieldLabel: '<?php
echo ext_Lang::msg('miscconfnewpass', true);
?>
',
name: 'newpwd2',
hiddenName: 'newpwd2',
inputType: 'password',
allowBlank:false
})
);
PassForm.addButton('<?php
echo ext_Lang::msg('btnchange', true);
?>
', function() {
if( !check_pwd() ) return;
statusBarMessage( 'Please wait...', true );
PassForm.submit({
//reset: true,
reset: false,
success: function(form, action) {
statusBarMessage( action.result.message, false, true );
},
failure: function(form, action) {
if( !action.result ) return;
Ext.MessageBox.alert('Error!', action.result.error);
statusBarMessage( action.result.error, false, true );
},
scope: PassForm,
// add some vars to the request, similar to hidden fields
params: {
option: 'com_extplorer',
action: 'admin',
action2: 'chpwd'
}
})
});
PassForm.render('passForm');
PassForm.findField('oldpwd').focus();
<?php
if ($admin) {
?>
// Edit / Add / Remove User
var UserForm = new Ext.form.Form({
labelWidth: 125, // label settings here cascade unless overridden
url:'<?php
echo basename($GLOBALS['script_name']);
//.........这里部分代码省略.........
示例6: execAction
function execAction($dir, $item)
{
// change permissions
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('chmod', false, $GLOBALS["error_msg"]["accessfunc"]);
}
if (!empty($GLOBALS['__POST']["selitems"])) {
$cnt = count($GLOBALS['__POST']["selitems"]);
} else {
$GLOBALS['__POST']["selitems"][] = $item;
$cnt = 1;
}
if (!empty($GLOBALS['__POST']['do_recurse'])) {
$do_recurse = true;
} else {
$do_recurse = false;
}
// Execute
if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
$bin = '';
for ($i = 0; $i < 3; $i++) {
for ($j = 0; $j < 3; $j++) {
$tmp = "r_" . $i . $j;
if (!empty($GLOBALS['__POST'][$tmp])) {
$bin .= '1';
} else {
$bin .= '0';
}
}
}
if ($bin == '0') {
// Changing permissions to "none" is not allowed
ext_Result::sendResult('chmod', false, $item . ": " . ext_Lang::err('chmod_none_not_allowed'));
}
$old_bin = $bin;
for ($i = 0; $i < $cnt; ++$i) {
if (ext_isFTPMode()) {
$mode = decoct(bindec($bin));
} else {
$mode = bindec($bin);
}
$item = $GLOBALS['__POST']["selitems"][$i];
if (ext_isFTPMode()) {
$abs_item = get_item_info($dir, $item);
} else {
$abs_item = get_abs_item($dir, $item);
}
if (!$GLOBALS['ext_File']->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);
//.........这里部分代码省略.........
示例7: search_items
function search_items($dir)
{
// search for item
if (isset($GLOBALS['__POST']["searchitem"])) {
$searchitem = stripslashes($GLOBALS['__POST']["searchitem"]);
$subdir = !empty($GLOBALS['__POST']["subdir"]);
$list = make_list($dir, $searchitem, $subdir);
} else {
$searchitem = NULL;
$subdir = true;
}
if (!empty($searchitem)) {
$msg = $GLOBALS["messages"]["actsearchresults"];
$msg .= ": (/" . get_rel_item($dir, $searchitem) . ")";
} else {
$msg = $GLOBALS["messages"]["searchlink"];
}
// Search Box
$response = ' <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;">' . $msg . '</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 form = new Ext.form.Form({
labelWidth: 125, // label settings here cascade unless overridden
url:\'' . basename($GLOBALS['script_name']) . '\'
});
form.add(
new Ext.form.TextField({
fieldLabel: \'' . ext_Lang::msg('nameheader', true) . '\',
name: \'searchitem\',
width:175,
allowBlank:false
}),
new Ext.form.Checkbox({
fieldLabel: \'' . ext_Lang::msg('miscsubdirs', true) . '?\',
name: \'subdir\',
checked: true
})
);
form.addButton({ text: "' . ext_Lang::msg('btnsearch', true) . '", type: "submit" }, function() {
form.submit({
waitMsg: \'' . ext_Lang::msg('search_processing', true) . '\',
//reset: true,
reset: false,
success: function(form, action) {
dialog_panel.setContent( action.result.message, true );
},
failure: function(form, action) {Ext.MessageBox.alert(\'' . ext_Lang::err('error') . '!\', action.result.error);},
scope: form,
// add some vars to the request, similar to hidden fields
params: {
option: \'com_extplorer\',
action: \'search\',
dir: \'' . $GLOBALS['__POST']["dir"] . '\'
}
});
});
form.addButton("' . ext_Lang::msg('btncancel', true) . '", function() { dialog.hide();dialog.destroy(); } );
form.render("adminForm");
</script>';
// Results
if ($searchitem != NULL) {
$response .= "<table width=\"95%\"><tr><td colspan=\"2\"><hr></td></tr>\n";
if (count($list) > 0) {
// table header
$response .= "<tr>\n<td width=\"42%\" class=\"header\"><b>" . $GLOBALS["messages"]["nameheader"];
$response .= "</b></td>\n<td width=\"58%\" class=\"header\"><b>" . $GLOBALS["messages"]["pathheader"];
$response .= "</b></td></tr>\n<tr><td colspan=\"2\"><hr></td></tr>\n";
// make & print table of found items
$response .= get_result_table($list);
$response .= "<tr><td colspan=\"2\"><hr></td></tr>\n<tr><td class=\"header\">" . count($list) . " ";
$response .= $GLOBALS["messages"]["miscitems"] . ".</td><td class=\"header\"></td></tr>\n";
} else {
$response .= "<tr><td>" . $GLOBALS["messages"]["miscnoresult"] . "</td></tr>";
}
$response .= "<tr><td colspan=\"2\"><hr></td></tr></table>\n";
}
if (empty($searchitem)) {
echo $response;
} else {
while (@ob_end_clean()) {
}
ext_Result::sendResult('search', true, $response);
}
}
示例8: if
statusBar.setStatus({
text: '<?php
echo ext_Lang::msg('success', true);
?>
: ' + msg,
iconCls: 'success',
clear: true
});
Ext.msgBoxSlider.msg('<?php
echo ext_Lang::msg('success', true);
?>
', msg );
} else if( success != null ) {
statusBar.setStatus({
text: '<?php
echo ext_Lang::err('error', true);
?>
: ' + msg,
iconCls: 'error',
clear: true
});
}
}
function selectFile( dir, file ) {
chDir( dir );
var conn = datastore.proxy.getConnection();
if( conn.isLoading() ) {
示例9: savefile
function savefile($file_name)
{
// save edited file
if (get_magic_quotes_gpc()) {
$code = stripslashes($GLOBALS['__POST']["code"]);
} else {
$code = $GLOBALS['__POST']["code"];
}
$langs = $GLOBALS["language"];
if ($langs == "japanese") {
$_encoding = $GLOBALS['__POST']["file_encoding"];
if ($_encoding != "UTF-8") {
$code = mb_convert_encoding($code, $_encoding, "UTF-8");
}
}
$res = $GLOBALS['ext_File']->file_put_contents($file_name, $code);
if ($res == false || PEAR::isError($res)) {
$err = basename($file_name) . ": " . ext_Lang::err('savefile');
if (PEAR::isError($res)) {
$err .= $res->getMessage();
}
ext_Result::sendResult('edit', false, $err);
}
}
示例10: execAction
function execAction($dir)
{
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('archive', false, $GLOBALS["error_msg"]["accessfunc"]);
}
if (!$GLOBALS["zip"] && !$GLOBALS["tgz"]) {
ext_Result::sendResult('archive', false, $GLOBALS["error_msg"]["miscnofunc"]);
}
$allowed_types = array('zip', 'tgz', 'tbz', 'tar');
// If we have something to archive, let's do it now
if (extGetParam($_POST, 'confirm') == 'true') {
$saveToDir = utf8_decode($GLOBALS['__POST']['saveToDir']);
if (!file_exists(get_abs_dir($saveToDir))) {
ext_Result::sendResult('archive', false, ext_Lang::err('archive_dir_notexists'));
}
if (!is_writable(get_abs_dir($saveToDir))) {
ext_Result::sendResult('archive', false, ext_Lang::err('archive_dir_unwritable'));
}
require_once _EXT_PATH . '/libraries/Archive/archive.php';
if (!in_array(strtolower($GLOBALS['__POST']["type"]), $allowed_types)) {
ext_Result::sendResult('archive', false, ext_Lang::err('extract_unknowntype') . ': ' . htmlspecialchars($GLOBALS['__POST']["type"]));
}
// This controls how many files are processed per Step (it's split up into steps to prevent time-outs)
$files_per_step = 2000;
$cnt = count($GLOBALS['__POST']["selitems"]);
$abs_dir = get_abs_dir($dir);
$name = basename(stripslashes($GLOBALS['__POST']["name"]));
if ($name == "") {
ext_Result::sendResult('archive', false, $GLOBALS["error_msg"]["miscnoname"]);
}
$startfrom = extGetParam($_REQUEST, 'startfrom', 0);
$dir_contents_cache_name = 'ext_' . md5(implode(null, $GLOBALS['__POST']["selitems"]));
$dir_contents_cache_file = _EXT_FTPTMP_PATH . '/' . $dir_contents_cache_name . '.txt';
$archive_name = get_abs_item($saveToDir, $name);
$fileinfo = pathinfo($archive_name);
if (empty($fileinfo['extension'])) {
$archive_name .= "." . $GLOBALS['__POST']["type"];
$fileinfo['extension'] = $GLOBALS['__POST']["type"];
foreach ($allowed_types as $ext) {
if ($GLOBALS['__POST']["type"] == $ext && @$fileinfo['extension'] != $ext) {
$archive_name .= "." . $ext;
}
}
}
if ($startfrom == 0) {
for ($i = 0; $i < $cnt; $i++) {
$selitem = stripslashes($GLOBALS['__POST']["selitems"][$i]);
if ($selitem == 'ext_root') {
$selitem = '';
}
if (is_dir(utf8_decode($abs_dir . "/" . $selitem))) {
$items = extReadDirectory(utf8_decode($abs_dir . "/" . $selitem), '.', true, true);
foreach ($items as $item) {
if (is_dir($item) || !is_readable($item) || $item == $archive_name) {
continue;
}
$v_list[] = str_replace('\\', '/', $item);
}
} else {
$v_list[] = utf8_decode(str_replace('\\', '/', $abs_dir . "/" . $selitem));
}
}
if (count($v_list) > $files_per_step) {
if (file_put_contents($dir_contents_cache_file, implode("\n", $v_list)) == false) {
ext_Result::sendResult('archive', false, 'Failed to create a temporary list of the directory contents');
}
}
} else {
$file_list_string = file_get_contents($dir_contents_cache_file);
if (empty($file_list_string)) {
ext_Result::sendResult('archive', false, 'Failed to retrieve the temporary list of the directory contents');
}
$v_list = explode("\n", $file_list_string);
}
$cnt_filelist = count($v_list);
// Now we go to the right range of files and "slice" the array
$v_list = array_slice($v_list, $startfrom, $files_per_step - 1);
$remove_path = $GLOBALS["home_dir"];
if ($dir) {
$remove_path .= $dir;
}
$debug = 'Starting from: ' . $startfrom . "\n";
$debug .= 'Files to process: ' . $cnt_filelist . "\n";
$debug .= implode("\n", $v_list);
//file_put_contents( 'log.txt', $debug, FILE_APPEND );
// Do some setup stuff
ini_set('memory_limit', '128M');
@set_time_limit(0);
error_reporting(E_ERROR | E_PARSE);
$result = extArchive::create($archive_name, $v_list, $GLOBALS['__POST']["type"], '', $remove_path);
if (PEAR::isError($result)) {
ext_Result::sendResult('archive', false, $name . ': ' . ext_Lang::err('archive_creation_failed') . ' (' . $result->getMessage() . $archive_name . ')');
}
$json = new ext_Json();
if ($cnt_filelist > $startfrom + $files_per_step) {
$response = array('startfrom' => $startfrom + $files_per_step, 'totalitems' => $cnt_filelist, 'success' => true, 'action' => 'archive', 'message' => sprintf(ext_Lang::msg('processed_x_files'), $startfrom + $files_per_step, $cnt_filelist));
} else {
@unlink($dir_contents_cache_file);
if ($GLOBALS['__POST']["type"] == 'tgz' || $GLOBALS['__POST']["type"] == 'tbz') {
chmod($archive_name, 0644);
//.........这里部分代码省略.........
示例11: die
die('Restricted access');
}
?>
<script type="text/javascript">
//<!--
function check_pwd() {
if(PassForm.findField('newpwd1').getValue() != PassForm.findField('newpwd2').getValue() ) {
alert("<?php
echo ext_Lang::msg('miscnopassmatch', true);
?>
");
return false;
}
if(PassForm.findField('oldpwd').getValue() ==PassForm.findField('newpwd1').getValue()) {
alert("<?php
echo ext_Lang::err('miscnopassdiff', true);
?>
");
return false;
}
return true;
}
// Edit / Delete
function Edit() {
document.userform.action2.value = "edituser";
document.userform.submit();
}
示例12: execAction
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 } );
}
}
},
//.........这里部分代码省略.........
示例13: execAction
function execAction($dir, $item)
{
global $mosConfig_absolute_path;
if (!ext_isArchive($item)) {
ext_Result::sendResult('archive', false, ext_Lang::err('extract_noarchive'));
} else {
$archive_name = realpath(get_abs_item($dir, $item));
$file_info = pathinfo($archive_name);
if (empty($dir)) {
$extract_dir = realpath($GLOBALS['home_dir']);
} else {
$extract_dir = realpath($GLOBALS['home_dir'] . "/" . $dir);
}
$ext = $file_info["extension"];
switch ($ext) {
case "zip":
require_once _EXT_PATH . "/libraries/Zip.php";
$extract_dir = str_replace('\\', '/', $extract_dir);
$zip = new Archive_Zip($archive_name);
$res = $zip->extract(array('add_path' => $extract_dir));
if ($res == 0) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure') . ' (' . $zip->errorInfo(true) . ')');
} else {
ext_Result::sendResult('extract', false, ext_Lang::msg('extract_success'));
}
break;
case "gz":
// a
// a
case "bz":
// lot
// lot
case "bz2":
// of
// of
case "bzip2":
// fallthroughs,
// fallthroughs,
case "tbz":
// don't
// don't
case "tar":
// wonder
require_once _EXT_PATH . "/libraries/Tar.php";
$archive = new Archive_Tar($archive_name);
if ($archive->extract($extract_dir)) {
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
} else {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure'));
}
break;
default:
ext_Result::sendResult('extract', false, ext_Lang::err('extract_unknowntype'));
break;
}
/*
require_once (_EXT_PATH . "/libraries/Archive/archive.php") ;
$result = extArchive::extract( $archive_name, $extract_dir ) ;
if( PEAR::isError( $result ) ) {
ext_Result::sendResult( 'extract', false, ext_Lang::err( 'extract_failure' ) . ': ' . $result->getMessage() ) ;
}
*/
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
}
示例14: execAction
function execAction()
{
$ftp_login = extGetParam($_POST, 'ftp_login_name', '');
$ftp_pass = extGetParam($_POST, 'ftp_login_pass', '');
global $dir, $mosConfig_live_site;
if ($ftp_login != '' || $ftp_pass != '') {
$ftp_host = extGetParam($_POST, 'ftp_hostname_port', 'localhost:21');
$url = @parse_url('ftp://' . $ftp_host);
if (empty($url)) {
ext_Result::sendResult('ftp_authentication', false, 'Unable to parse the specified Host Name. Please use a hostname in this format: hostname:21');
}
$port = empty($url['port']) ? 21 : $url['port'];
$ftp = new Net_FTP($url['host'], $port, 20);
$res = $ftp->connect();
if (PEAR::isError($res)) {
ext_Result::sendResult('ftp_authentication', false, $GLOBALS['messages']['ftp_connection_failed'] . ' (' . $url['host'] . ')');
} else {
$res = $ftp->login($ftp_login, $ftp_pass);
$ftp->disconnect();
if (PEAR::isError($res)) {
ext_Result::sendResult('ftp_authentication', false, $GLOBALS['messages']['ftp_login_failed']);
}
$_SESSION['ftp_login'] = $ftp_login;
$_SESSION['ftp_pass'] = $ftp_pass;
$_SESSION['ftp_host'] = $ftp_host;
$_SESSION['file_mode'] = 'ftp';
session_write_close();
ext_Result::sendResult('ftp_authentication', true, ext_Lang::msg('actlogin_success'));
}
} else {
?>
{
"xtype": "form",
"id": "simpleform",
"labelWidth": 125,
"url":"<?php
echo basename($GLOBALS['script_name']);
?>
",
"dialogtitle": "<?php
echo $GLOBALS["messages"]["ftp_header"];
?>
",
"title": "<?php
echo $GLOBALS["messages"]["ftp_login_lbl"];
?>
",
"frame": true,
"keys": {
"key": Ext.EventObject.ENTER,
"fn" : function(){
if (Ext.getCmp("simpleform").getForm().isValid()) {
statusBarMessage( '<?php
echo ext_Lang::msg('ftp_login_check', true);
?>
', true );
Ext.getCmp("simpleform").getForm().submit({
"reset": false,
"success": function(form, action) { location.reload() },
"failure": function(form, action) {
if( !action.result ) return;
Ext.Msg.alert('<?php
echo ext_Lang::err('error', true);
?>
', action.result.error);
statusBarMessage( action.result.error, false, false );
},
"scope": Ext.getCmp("simpleform").getForm(),
"params": {
"option": "com_extplorer",
"action": "ftp_authentication"
}
});
} else {
return false;
}
}
},
"items": [{
"xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('ftp_login_name', true);
?>
",
"name": "ftp_login_name",
"width":175,
"allowBlank":false
},{
"xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('ftp_login_pass', true);
?>
",
"name": "ftp_login_pass",
"inputType": "password",
"width":175,
"allowBlank":false
},{
"xtype": "textfield",
"fieldLabel": "<?php
//.........这里部分代码省略.........
示例15: die
<?php
/** ensure this file is being included by a parent file */
if (!defined('_JEXEC') && !defined('_VALID_MOS')) {
die('Restricted access');
}
?>
<script type="text/javascript">
//<!--
function check_pwd() {
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('pass1').getValue() != userform.findField('pass2').getValue())
{
Ext.Msg.alert('Status', "<?php
echo ext_Lang::err('miscnopassmatch', true);
?>
");
return false;
}
return true;
}
// -->
</script>