当前位置: 首页>>代码示例>>PHP>>正文


PHP module_controller::invalidPath方法代码示例

本文整理汇总了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;
 }
开发者ID:Boter,项目名称:madmin-core,代码行数:51,代码来源:controller.ext.php


注:本文中的module_controller::invalidPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。