本文整理汇总了PHP中module_controller::invalidPath方法的典型用法代码示例。如果您正苦于以下问题:PHP module_controller::invalidPath方法的具体用法?PHP module_controller::invalidPath怎么用?PHP module_controller::invalidPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module_controller
的用法示例。
在下文中一共展示了module_controller::invalidPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ExecuteCreateFTP
static function ExecuteCreateFTP($uid, $username, $password, $destination, $domainDestination, $access_type, $home)
{
global $zdbh;
global $controller;
$currentuser = ctrl_users::GetUserDetail($uid);
$username = $currentuser['username'] . '_' . $username;
runtime_hook::Execute('OnBeforeCreateFTPAccount');
if (fs_director::CheckForEmptyValue(self::CheckForErrors($username, $password))) {
// Check to see if its a new home directory or use a current one...
if ($home == 1) {
$homedirectory_to_use = '/' . str_replace('.', '_', $username);
$full_path = ctrl_options::GetSystemOption('hosted_dir') . $currentuser['username'] . $homedirectory_to_use . '/';
// Create the new home directory... (If it doesnt already exist.)
if (!file_exists($full_path)) {
@mkdir($full_path, 777);
@chmod($full_path, 0777);
}
} else {
if ($home == 3) {
$homedirectory_to_use = '/' . $domainDestination;
} else {
$homedirectory_to_use = '/' . $destination;
}
}
// Check if Path is inside user home directory.
$full_homeDir = ctrl_options::GetSystemOption('hosted_dir') . $currentuser['username'] . $homedirectory_to_use . '/';
$baseDir = ctrl_options::GetSystemOption('hosted_dir') . $currentuser['username'];
$realPath = realpath($full_homeDir);
if (0 !== strpos($realPath, $baseDir)) {
self::$invalidPath = true;
return false;
}
$sql = $zdbh->prepare("INSERT INTO x_ftpaccounts (ft_acc_fk, ft_user_vc, ft_directory_vc, ft_access_vc, ft_password_vc, ft_created_ts) VALUES (:userid, :username, :homedir, :accesstype, :password, :time)");
$sql->bindParam(':userid', $currentuser['userid']);
$sql->bindParam(':username', $username);
$sql->bindParam(':homedir', $homedirectory_to_use);
$sql->bindParam(':accesstype', $access_type);
$sql->bindParam(':password', $password);
$sql->bindParam(':time', time());
$sql->execute();
self::$create = true;
// Include FTP server specific file here.
$FtpModuleFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('ftp_php');
if (file_exists($FtpModuleFile)) {
include $FtpModuleFile;
}
runtime_hook::Execute('OnAfterCreateFTPAccount');
return true;
}
return false;
}