本文整理汇总了PHP中JArrayHelper::get方法的典型用法代码示例。如果您正苦于以下问题:PHP JArrayHelper::get方法的具体用法?PHP JArrayHelper::get怎么用?PHP JArrayHelper::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JArrayHelper
的用法示例。
在下文中一共展示了JArrayHelper::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ftp_authentication
/**
* @author soeren
* @copyright soeren (C) 2006
*
* This file handles ftp authentication
*/
function ftp_authentication($ftp_login = '', $ftp_pass = '')
{
global $dir;
if ($ftp_login != '' || $ftp_pass != '') {
while (@ob_end_clean()) {
}
@header("Status: 200 OK");
$ftp_host = JArrayHelper::get($_POST, 'ftp_host', 'localhost:21');
$url = @parse_url('ftp://' . $ftp_host);
if (empty($url)) {
echo nx_alertBox('Unable to parse the specified Host Name. Please use a hostname in this format: hostname:21');
echo nx_scriptTag('', '$(\'loadingindicator\').innerHTML = \'\';');
echo 'Unable to parse the specified Host Name. Please use a hostname in this format: hostname:21';
exit;
}
$port = empty($url['port']) ? 21 : $url['port'];
$ftp = new Net_FTP($url['host'], $port, 20);
$res = $ftp->connect();
if (PEAR::isError($res)) {
echo nx_alertBox($GLOBALS['messages']['ftp_connection_failed']);
echo nx_scriptTag('', '$(\'loadingindicator\').innerHTML = \'\';');
echo $GLOBALS['messages']['ftp_connection_failed'] . '<br />[' . $res->getMessage() . ']';
exit;
} else {
$res = $ftp->login($ftp_login, $ftp_pass);
$ftp->disconnect();
if (PEAR::isError($res)) {
echo nx_alertBox($GLOBALS['messages']['ftp_login_failed']);
echo nx_scriptTag('', '$(\'loadingindicator\').innerHTML = \'\';');
echo $GLOBALS['messages']['ftp_login_failed'] . '<br />[' . $res->getMessage() . ']';
exit;
}
echo nx_alertBox('Login OK!');
$_SESSION['ftp_login'] = $ftp_login;
$_SESSION['ftp_pass'] = $ftp_pass;
$_SESSION['ftp_host'] = $_POST['ftp_host'];
session_write_close();
echo nx_docLocation(str_replace('index3.php', 'index2.php', make_link('list', '') . '&file_mode=ftp'));
exit;
}
} else {
?>
<script type="text/javascript" src="components/com_osefileman/scripts/mootools.ajax.js"></script>
<script type="text/javascript" src="components/com_osefileman/scripts/functions.js"></script>
<script type="text/javascript">
function checkFTPAuth( url ) {
showLoadingIndicator( $('loadingindicator'), true );
$('loadingindicator').innerHTML += ' <strong><?php
echo $GLOBALS['messages']['ftp_login_check'];
?>
</strong>';
var controller = new ajax( url, { postBody: $('adminform'),
evalScripts: true,
update: 'statustext'
}
);
controller.request();
return false;
}
</script>
<?php
show_header($GLOBALS["messages"]["ftp_header"]);
?>
<br/>
<form name="ftp_auth_form" method="post" action="<?php
echo JURI::root();
?>
"/administrator/index3.php" onsubmit="return checkFTPAuth('<?php
echo JURI::root();
?>
/administrator/index3.php');" id="adminform">
<input type="hidden" name="no_html" value="1" />
<table class="adminform" style="width:400px;">
<tr><th colspan="3"><?php
echo $GLOBALS["messages"]["ftp_login_lbl"];
?>
</th></tr>
<tr><td colspan="3" style="text-align:center;" id="loadingindicator"></td></tr>
<tr><td colspan="3" style="font-weight:bold;text-align:center" id="statustext"> </td></tr>
<tr>
<td width="50" style="text-align:center;" rowspan="3"><img align="absmiddle" src="images/security_f2.png" alt="Login!" /></td>
<td><?php
echo $GLOBALS["messages"]["ftp_login_name"];
?>
:</td>
<td align="left">
<input type="text" name="ftp_login_name" size="25" title="<?php
echo $GLOBALS["messages"]["ftp_login_name"];
//.........这里部分代码省略.........