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


PHP module_controller::create方法代码示例

本文整理汇总了PHP中module_controller::create方法的典型用法代码示例。如果您正苦于以下问题:PHP module_controller::create方法的具体用法?PHP module_controller::create怎么用?PHP module_controller::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在module_controller的用法示例。


在下文中一共展示了module_controller::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

示例2: ExecuteCreateForwarder

 static function ExecuteCreateForwarder($uid, $address, $dname, $ddomain, $keepmessage)
 {
     global $zdbh;
     global $controller;
     $currentuser = ctrl_users::GetUserDetail($uid);
     if (fs_director::CheckForEmptyValue(self::CheckCreateForErrors($address, $dname, $ddomain, $keepmessage))) {
         return false;
     }
     $destination = strtolower(str_replace(' ', '', $dname . '@' . $ddomain));
     runtime_hook::Execute('OnBeforeCreateForwarder');
     self::$create = true;
     // Include mail server specific file here.
     $MailServerFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('mailserver_php');
     if (file_exists($MailServerFile)) {
         include $MailServerFile;
     }
     $sql = "INSERT INTO x_forwarders (fw_acc_fk,\n\t\t\t\t\t\t\t\t\t\t\t  fw_address_vc,\n\t\t\t\t\t\t\t\t\t\t\t  fw_destination_vc,\n\t\t\t\t\t\t\t\t\t\t\t  fw_keepmessage_in,\n\t\t\t\t\t\t\t\t\t\t\t  fw_created_ts) VALUES (\n\t\t\t\t\t\t\t\t\t\t\t  :userid,\n\t\t\t\t\t\t\t\t\t\t\t  :address,\n\t\t\t\t\t\t\t\t\t\t\t  :destination,\n\t\t\t\t\t\t\t\t\t\t\t  :keepmessage,\n\t\t\t\t\t\t\t\t\t\t\t  :time)";
     $sql = $zdbh->prepare($sql);
     $sql->bindParam(':userid', $currentuser['userid']);
     $sql->bindParam(':address', $address);
     $sql->bindParam(':destination', $destination);
     $sql->bindParam(':keepmessage', $keepmessage);
     $sql->bindParam(':time', time());
     $sql->execute();
     runtime_hook::Execute('OnAfterCreateForwarder');
     self::$ok = true;
     return true;
 }
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:28,代码来源:controller.ext.php

示例3: ExecuteAddDistList

 static function ExecuteAddDistList($uid, $inAddress, $inDomain)
 {
     global $zdbh;
     global $controller;
     $currentuser = ctrl_users::GetUserDetail($uid);
     $fulladdress = strtolower(str_replace(' ', '', $inAddress . '@' . $inDomain));
     if (fs_director::CheckForEmptyValue(self::CheckCreateForErrors($inAddress, $inDomain))) {
         return false;
     }
     runtime_hook::Execute('OnBeforeAddDistList');
     self::$create = true;
     // Include mail server specific file here.
     $MailServerFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('mailserver_php');
     if (file_exists($MailServerFile)) {
         include $MailServerFile;
     }
     $sqlStatment = "INSERT INTO x_distlists (dl_acc_fk,\n\t\t\t\t\t\t\t\t\t\t  dl_address_vc,\n\t\t\t\t\t\t\t\t\t\t  dl_created_ts) VALUES (\n\t\t\t\t\t\t\t\t\t\t  :userid,\n\t\t\t\t\t\t\t\t\t\t  :fulladdress,\n\t\t\t\t\t\t\t\t\t\t  :time)";
     $sql = $zdbh->prepare($sqlStatment);
     $sql->bindParam(':userid', $currentuser['userid']);
     $sql->bindParam(':fulladdress', $fulladdress);
     $sql->bindParam(':time', time());
     $sql->execute();
     runtime_hook::Execute('OnAfterAddDistList');
     self::$ok = true;
     return true;
 }
开发者ID:caglaroflazoglu,项目名称:sentora-core,代码行数:26,代码来源:controller.ext.php

示例4: ExecuteCreateAlias

 static function ExecuteCreateAlias($uid, $address, $domain, $destination)
 {
     global $zdbh;
     global $controller;
     $currentuser = ctrl_users::GetUserDetail($uid);
     if (fs_director::CheckForEmptyValue(self::CheckCreateForErrors($address, $domain, $destination))) {
         return false;
     }
     runtime_hook::Execute('OnBeforeCreateAlias');
     $address = str_replace('*', '', $address);
     $fulladdress = $address . "@" . $domain;
     $destination = strtolower(str_replace(' ', '', $destination));
     self::$create = true;
     // Include mail server specific file here.
     include "modules/" . $controller->GetControllerRequest('URL', 'module') . "/code/" . ctrl_options::GetSystemOption('mailserver_php') . "";
     $bindArray = array(':userid' => $currentuser['userid'], ':fulladdress' => $fulladdress, ':destination' => $destination, ':time' => time());
     $sql = "INSERT INTO x_aliases (al_acc_fk,\n\t\t\t\t\t\t\t\t\t\t\t  al_address_vc,\n\t\t\t\t\t\t\t\t\t\t\t  al_destination_vc,\n\t\t\t\t\t\t\t\t\t\t\t  al_created_ts) VALUES (\n\t\t\t\t\t\t\t\t\t\t\t  :userid,\n\t\t\t\t\t\t\t\t\t\t\t  :fulladdress,\n\t\t\t\t\t\t\t\t\t\t\t  :destination,\n\t\t\t\t\t\t\t\t\t\t\t  :time)";
     if ($zdbh->bindQuery($sql, $bindArray)) {
         runtime_hook::Execute('OnAfterCreateAlias');
         self::$ok = true;
         return true;
     } else {
         return false;
     }
 }
开发者ID:Boter,项目名称:madmin-core,代码行数:25,代码来源:controller.ext.php

示例5: ExecuteAddMailbox

    static function ExecuteAddMailbox($uid, $address, $domain, $password)
    {
        global $zdbh;
        global $controller;
        $currentuser = ctrl_users::GetUserDetail($uid);
        if (fs_director::CheckForEmptyValue(self::CheckCreateForErrors($address, $domain, $password))) {
            return false;
        }
        runtime_hook::Execute('OnBeforeCreateMailbox');
        $address = strtolower(str_replace(' ', '', $address));
        $fulladdress = strtolower(str_replace(' ', '', $address . "@" . $domain));
        self::$create = true;
        // Include mail server specific file here.
        $MailServerFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('mailserver_php');
        if (file_exists($MailServerFile))
            include($MailServerFile);

        $sql = "INSERT INTO x_mailboxes (mb_acc_fk,
											 mb_address_vc,
											 mb_created_ts) VALUES (
											 :userid,
											 :fulladdress,
											 :time)";
        $time = time();
        $sql = $zdbh->prepare($sql);
        $sql->bindParam(':time', $time);
        $sql->bindParam(':userid', $currentuser['userid']);
        $sql->bindParam(':fulladdress', $fulladdress);
        $sql->execute();
        runtime_hook::Execute('OnAfterCreateMailbox');
        self::$ok = true;
        return true;
    }
开发者ID:remzicelik,项目名称:sentora-core,代码行数:33,代码来源:controller.ext.php


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