This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[MODULE] Certificate Manager
#29
[Not Solved] RE: [Module] Certificate Manager
(10-10-2015, 03:19 PM)MarkDark Wrote: I have a module for the SSL Manager for AWServer with ZPanelX it works fine but is based on the individual config files.
my SSL Manager integrated in version AWServer with ZPanelX 2.2
For create ssl certificates used tools openssl.exe
work fine Smile 

It's my controller.ext.php (module SSL Manager)
I use your idea - ssl module
Thanks!


Code:
class module_controller
{

    static $ok;
    static $error;
    static $empty;
    static $reqadd;
    static $del;

    static function ListDomains($uid)
    {
        global $zdbh;
        global $controller;
        $currentuser = ctrl_users::GetUserDetail($uid);
        $sql = "SELECT * FROM x_vhosts WHERE vh_acc_fk=:userid AND vh_enabled_in=1 AND vh_deleted_ts IS NULL ORDER BY vh_name_vc ASC";
        $numrows = $zdbh->prepare($sql);
        $numrows->bindParam(':userid', $currentuser['userid']);
        $numrows->execute();
        if ($numrows->fetchColumn() <> 0) {
            $sql = $zdbh->prepare($sql);
            $sql->bindParam(':userid', $currentuser['userid']);
            $res = array();
            $sql->execute();
        while ($rowdomains = $sql->fetch()) {
            $res[] = array('domain' => $rowdomains['vh_name_vc']);
        }
           return $res;
       } else {
            return false;
        }
    }
    
    static function ListSSL($uname)
    {
        global $zdbh;
        global $controller;
        if (!is_dir("" . ctrl_options::GetSystemOption('hosted_dir') . $uname ."/ssl/") ) {
                mkdir("" . ctrl_options::GetSystemOption('hosted_dir') . $uname ."/ssl/", 0777);
        }
        $dir = ctrl_options::GetSystemOption('hosted_dir') . $uname ."/ssl/";
        if(substr($dir, -1) != "/") $dir .= "/";
        $d = @dir($dir);
        while(false !== ($entry = $d->read())) {
            $entryssl = str_replace('_', '.', $entry);
            if($entry[0] == ".") continue;
            $retval[] = array("name" => "$entryssl");
        }
   $d->close();
        return $retval;
    }

    static function ExecuteDeleteSSL($domain, $username)
    {
        global $zdbh;
        global $controller;
        $domainssl = str_replace('.', '_', $domain);
        $dir = ctrl_options::GetSystemOption('hosted_dir') . $username ."/ssl/". $domainssl;
        $objects = scandir($dir);
        foreach ($objects as $object) {
        if ($object != "." && $object != "..") {
            unlink($dir."/".$object);
        }
    }
        reset($objects);
        rmdir($dir);
        unlink("C:/AWServer/bin/apache/conf/ssl-vhost/" . $domain . ".conf");    
        unlink("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/". $domain .".key");
        unlink("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/". $domain .".crt");
        
        self::$del = true;
        return true;
        
    }
    
    static function SetWriteApacheConfigTrue() {
        global $zdbh;
        $sql = $zdbh->prepare("UPDATE x_settings
                                SET so_value_tx='true'
                                WHERE so_name_vc='apache_changed'");
        $sql->execute();
    }
    
    static function ExecuteCSR($domain, $name, $address, $city, $country, $company, $department)
    {
        global $zdbh;
        global $controller;
        $currentuser = ctrl_users::GetUserDetail();
        $formvars = $controller->GetAllControllerRequests('FORM');
        if (!is_dir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/") ) {
                mkdir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/", 0777);
            }
        $dn = array(
                        "countryName"            => "$country",
                        "stateOrProvinceName"    => "$name",
                        "localityName"            => "$city",
                        "organizationName"        => "$company",
                        "departmentName"        => "$department",
                        "commonName"            => "$domain",
                        "emailAddress"            => "$address"
                    );

        // Make key and signing request SSL certificate
        @exec("C:/AWServer/bin/apache/bin/openssl.exe genrsa -out " . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/". $domain .".key 2048");
        @exec("C:/AWServer/bin/apache/bin/openssl.exe req -new -key " . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/". $domain .".key -out " . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/". $domain .".csr -subj /C=". $country ."/ST=". $name ."/L=". $city ."/O=". $company = str_replace(' ', '-' ,$company) ."/OU=". $department = str_replace(' ', '-' ,$department) ."/CN=". $domain ."/emailAddress=". $address . "");
        unlink("C:/.rnd");
        
        $email = $address;
        $emailsubject = "Certificate Signing Request";
        $emailbody = "Hi $currentuser[fullname] \n\nYour application is made.\nYour request to signing SSL certificate for domain - $domain.csr \nYour private key for domain - $domain.key \nSee  attachments. \n\nBest Regards. \nYour hosting company";

        $phpmailer = new sys_email();
        $phpmailer->Subject = $emailsubject;
        $phpmailer->Body = $emailbody;
        $phpmailer->AddAttachment("". ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/".$domain.".key");
        $phpmailer->AddAttachment("". ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/".$domain.".csr");
        $phpmailer->AddAddress($email);
        $phpmailer->SendEmail();

        unlink("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/".$domain.".key");
        unlink("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/".$domain.".csr");
        rmdir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/key/");

        self::$reqadd = true;
        return true;
    }

    static function ExecuteMakeSSL($domain, $name, $address, $city, $country)
    {
        global $zdbh;
        global $controller;
        $currentuser = ctrl_users::GetUserDetail();
        $formvars = $controller->GetAllControllerRequests('FORM');
        $rootdir = str_replace('.', '_', $domain);
                
        if (!is_dir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/") ) {
                mkdir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/", 0777);
            }
        if (!is_dir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/") ) {
                mkdir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/", 0777);
        } else {
            self::$error = true;
            return false;
        }
        
        $dn = array(
                        "countryName"            => "$country",
                        "stateOrProvinceName"    => "$name",
                        "localityName"            => "$city",
                        "commonName"            => "$domain",
                        "emailAddress"            => "$address"
                    );

        // Make key and self-signed SSL certificate
        @exec("C:/AWServer/bin/apache/bin/openssl.exe req -new -x509 -nodes -days 3660 -newkey rsa:2048 -keyout " . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/". $domain .".key -out " . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/". $domain .".crt -subj /C=". $country ."/ST=". $name ."/L=". $city ."/O=AWServer/OU=Hosting/CN=". $domain ."/emailAddress=". $address . "");
        unlink("C:/AWServer/panel/.rnd");

        // Get the values ​​of PHP memory limit their module in the package
        $rows = $zdbh->prepare("SELECT * FROM x_quotas WHERE qt_package_fk=" . $currentuser['packageid']);
        $rows->execute();
        $quotasinfo = $rows->fetch();
        
        // Writing ssl configuration file
        $handle = fopen("C:/AWServer/bin/apache/conf/ssl-vhost/". $domain .".conf", "w+");
        fwrite($handle, $write);
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        $write = "# Generated by AWServer with ZPanelX SSL VHost configurations below #\n";
        fwrite($handle, $write);
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        $write = " \n";
        fwrite($handle, $write);
        $write = "NameVirtualHost *:443\n";
        fwrite($handle, $write);
        $write = " \n";
        fwrite($handle, $write);
        $write = "<VirtualHost *:443>\n";
        fwrite($handle, $write);
        $write = "    ServerName $domain\n";
        fwrite($handle, $write);
        $write = "    ServerAlias $domain www.$domain\n";
        fwrite($handle, $write);
        $write = "    ServerAdmin $currentuser[email]\n";
        fwrite($handle, $write);
        $write = "    SSLEngine On\n";
        fwrite($handle, $write);
        $write = "    SSLCertificateFile \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/ssl/$rootdir/$domain.crt\"\n";
        fwrite($handle, $write);
        $write = "    SSLCertificateKeyFile \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/ssl/$rootdir/$domain.key\"\n";
        fwrite($handle, $write);
        $write = "    php_admin_value open_basedir \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/public_html/$rootdir" . ctrl_options::GetSystemOption('openbase_seperator') . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/tmp" . ctrl_options::GetSystemOption('openbase_seperator') . ctrl_options::GetSystemOption('openbase_temp') . ctrl_options::GetSystemOption('openbase_seperator') . ctrl_options::GetSystemOption('pear_path') . ctrl_options::GetSystemOption('openbase_seperator') . ctrl_options::GetSystemOption('imagick_path') . "\"\n";
        fwrite($handle, $write);
        $write = "    " . ctrl_options::GetSystemOption('suhosin_value') . "\n";
        fwrite($handle, $write);
        $write = "    php_admin_value upload_tmp_dir \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/tmp\"\n";
        fwrite($handle, $write);
        $write = "    php_admin_value session.save_path \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/tmp\"\n";
        fwrite($handle, $write);
        $write = "    php_admin_value memory_limit " . $quotasinfo['qt_memlimit_mb'] . "M"."\n";
        fwrite($handle, $write);
        $write = "    ErrorLog \"" . ctrl_options::GetSystemOption('log_dir') . "domains/$currentuser[username]/$domain-error.log\"\n";
        fwrite($handle, $write);
        $write = "    CustomLog \"" . ctrl_options::GetSystemOption('log_dir') . "domains/$currentuser[username]/$domain-access.log\" " . ctrl_options::GetSystemOption('access_log_format') . "\n";
        fwrite($handle, $write);
        $write = "    CustomLog \"" . ctrl_options::GetSystemOption('log_dir') . "domains/$currentuser[username]/$domain-bandwidth.log\" " . ctrl_options::GetSystemOption('bandwidth_log_format') . "\n";
        fwrite($handle, $write);
        $write = "    DocumentRoot \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/public_html/$rootdir\"\n";
        fwrite($handle, $write);
        $write = "<Directory \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/public_html/$rootdir\">\n";
        fwrite($handle, $write);
        $write = "    Options FollowSymLinks\n";
        fwrite($handle, $write);
        $write = "    AllowOverride All\n";
        fwrite($handle, $write);
        $write = "    Order Allow,Deny\n";
        fwrite($handle, $write);
        $write = "    Allow from all\n";
        fwrite($handle, $write);
        $write = "</Directory>\n";
        fwrite($handle, $write);
        $write = "    ". ctrl_options::GetSystemOption('dir_index') . "\n";
        fwrite($handle, $write);
        $write = "    ". ctrl_options::GetSystemOption('php_handler') . "\n";
        fwrite($handle, $write);
        $write = "    ScriptAlias /cgi-bin/ \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/public_html/$rootdir/_cgi-bin\"\n";
        fwrite($handle, $write);
        $write = "" . ctrl_options::GetSystemOption('cgi_handler') . "\n";
        fwrite($handle, $write);
        $write = " \n";
        fwrite($handle, $write);
        $write = "    # Custom global settings are loaded below this line (if any exist)\n";
        fwrite($handle, $write);
        $write = "    ". ctrl_options::GetSystemOption('global_vhcustom') . "\n";
        fwrite($handle, $write);
        $write = "</VirtualHost>\n";
        fwrite($handle, $write);
        fclose($handle);

        // Writing .htaccess file
        $handle = fopen("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/public_html/". $rootdir ."/".".htaccess", "w+");
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        $write = "# Generated by AWServer with ZPanelX SSL VHost configurations below #\n";
        fwrite($handle, $write);
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        $write = " \n";
        $write = "RewriteEngine On\n";
        fwrite($handle, $write);
        $write = "RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]\n";
        fwrite($handle, $write);
        $write = "RewriteRule ^(.*)$ http://%1/$1 [R=301,L]\n";
        fwrite($handle, $write);
        $write = "RewriteCond %{SERVER_PORT} !^443$\n";
        fwrite($handle, $write);
        $write = "RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]\n";
        fwrite($handle, $write);
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        fclose($handle);            
        
        // Restart apache during the next start daemon
        self::SetWriteApacheConfigTrue();
        self::$ok = true;
        return true;
    }
    
    static function doUploadSSL()
    {
        global $zdbh;
        global $controller;
        $currentuser = ctrl_users::GetUserDetail();
        $formvars = $controller->GetAllControllerRequests('FORM');
        $domain = $formvars["inDomain"];
        $rootdir = str_replace('.', '_', $domain);
        if (empty($_FILES["inKEY"]["name"]) || empty($_FILES["inWCA"]["name"])) {
        self::$empty = true;
        return false;
        }
        if (!is_dir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/") ) {
                mkdir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/", 0777);
            }
        if (!is_dir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/") ) {
                mkdir("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/", 0777);
        } else {
            self::$error = true;
            return false;
        }
            
        $target_dir = "" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/ssl/". $rootdir ."/";
            
        $uploadwcrt    = $target_dir . $domain . ".crt";
        $uploadkey    = $target_dir . $domain . ".key";
        $uploadicrt    = $target_dir . $domain . ".ca-bundle";
            
        move_uploaded_file($_FILES["inWCA"]["tmp_name"], $uploadwcrt);
        move_uploaded_file($_FILES["inKEY"]["tmp_name"], $uploadkey);
        move_uploaded_file($_FILES["inICA"]["tmp_name"], $uploadicrt);

        // Get the values ​​of PHP memory limit their module in the package
        $rows = $zdbh->prepare("SELECT * FROM x_quotas WHERE qt_package_fk=" . $currentuser['packageid']);
        $rows->execute();
        $quotasinfo = $rows->fetch();        

        // Writing ssl configuration file
        $handle = fopen("C:/AWServer/bin/apache/conf/ssl-vhost/". $domain .".conf", "w+");
        fwrite($handle, $write);
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        $write = "# Generated by AWServer with ZPanelX SSL VHost configurations below #\n";
        fwrite($handle, $write);
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        $write = " \n";
        fwrite($handle, $write);
        $write = "NameVirtualHost *:443\n";
        fwrite($handle, $write);
        $write = " \n";
        fwrite($handle, $write);
        $write = "<VirtualHost *:443>\n";
        fwrite($handle, $write);
        $write = "    ServerName $domain\n";
        fwrite($handle, $write);
        $write = "    ServerAlias $domain www.$domain\n";
        fwrite($handle, $write);
        $write = "    ServerAdmin $currentuser[email]\n";
        fwrite($handle, $write);
        $write = "    SSLEngine On\n";
        fwrite($handle, $write);
        $write = "    SSLCertificateFile \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/ssl/$rootdir/$domain.crt\"\n";
        fwrite($handle, $write);
        $write = "    SSLCertificateKeyFile \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/ssl/$rootdir/$domain.key\"\n";
        fwrite($handle, $write);
        $write = "    SSLCertificateChainFile    \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/ssl/$rootdir/$domain.ca-bundle\"\n";            
        fwrite($handle, $write);
        $write = "    php_admin_value open_basedir \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/public_html/$rootdir" . ctrl_options::GetSystemOption('openbase_seperator') . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/tmp" . ctrl_options::GetSystemOption('openbase_seperator') . ctrl_options::GetSystemOption('openbase_temp') . ctrl_options::GetSystemOption('openbase_seperator') . ctrl_options::GetSystemOption('pear_path') . ctrl_options::GetSystemOption('openbase_seperator') . ctrl_options::GetSystemOption('imagick_path') . "\"\n";
        fwrite($handle, $write);
        $write = "    " . ctrl_options::GetSystemOption('suhosin_value') . "\n";
        fwrite($handle, $write);
        $write = "    php_admin_value upload_tmp_dir \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/tmp\"\n";
        fwrite($handle, $write);
        $write = "    php_admin_value session.save_path \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/tmp\"\n";
        fwrite($handle, $write);
        $write = "    php_admin_value memory_limit " . $quotasinfo['qt_memlimit_mb'] . "M"."\n";
        fwrite($handle, $write);
        $write = "    ErrorLog \"" . ctrl_options::GetSystemOption('log_dir') . "domains/$currentuser[username]/$domain-error.log\"\n";
        fwrite($handle, $write);
        $write = "    CustomLog \"" . ctrl_options::GetSystemOption('log_dir') . "domains/$currentuser[username]/$domain-access.log\" " . ctrl_options::GetSystemOption('access_log_format') . "\n";
        fwrite($handle, $write);
        $write = "    CustomLog \"" . ctrl_options::GetSystemOption('log_dir') . "domains/$currentuser[username]/$domain-bandwidth.log\" " . ctrl_options::GetSystemOption('bandwidth_log_format') . "\n";
        fwrite($handle, $write);
        $write = "    DocumentRoot \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/public_html/$rootdir/\"\n";
        fwrite($handle, $write);
        $write = "<Directory \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/public_html/$rootdir/\">\n";
        fwrite($handle, $write);
        $write = "    Options FollowSymLinks\n";
        fwrite($handle, $write);
        $write = "    AllowOverride All\n";
        fwrite($handle, $write);
        $write = "    Order Allow,Deny\n";
        fwrite($handle, $write);
        $write = "    Allow from all\n";
        fwrite($handle, $write);
        $write = "</Directory>\n";
        fwrite($handle, $write);
        $write = "    ". ctrl_options::GetSystemOption('dir_index') . "\n";
        fwrite($handle, $write);
        $write = "    ". ctrl_options::GetSystemOption('php_handler') . "\n";
        fwrite($handle, $write);
        $write = "    ScriptAlias /cgi-bin/ \"" . ctrl_options::GetSystemOption('hosted_dir') . "$currentuser[username]/public_html/$rootdir/_cgi-bin\"\n";
        fwrite($handle, $write);
        $write = "" . ctrl_options::GetSystemOption('cgi_handler') . "\n";
        fwrite($handle, $write);
        $write = " \n";
        fwrite($handle, $write);
        $write = "    # Custom global settings are loaded below this line (if any exist)\n";
        fwrite($handle, $write);
        $write = "    ". ctrl_options::GetSystemOption('global_vhcustom') . "\n";
        fwrite($handle, $write);
        $write = "</VirtualHost>\n";
        fwrite($handle, $write);
        fclose($handle);

        // Writing .htaccess file
        $handle = fopen("" . ctrl_options::GetSystemOption('hosted_dir') . $currentuser["username"] ."/public_html/". $rootdir ."/".".htaccess", "w+");
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        $write = "# Generated by AWServer with ZPanelX SSL VHost configurations below #\n";
        fwrite($handle, $write);
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        $write = " \n";
        $write = "RewriteEngine On\n";
        fwrite($handle, $write);
        $write = "RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]\n";
        fwrite($handle, $write);
        $write = "RewriteRule ^(.*)$ http://%1/$1 [R=301,L]\n";
        fwrite($handle, $write);
        $write = "RewriteCond %{SERVER_PORT} !^443$\n";
        fwrite($handle, $write);
        $write = "RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]\n";
        fwrite($handle, $write);
        $write = "#####################################################################\n";
        fwrite($handle, $write);
        fclose($handle);
        
        // Restart apache during the next start daemon
        self::SetWriteApacheConfigTrue();
        self::$ok = true;
        return true;
    }

    static function doMakeNewSSL()
   {
       global $controller;
       runtime_csfr::Protect();
       $currentuser = ctrl_users::GetUserDetail();
       $formvars = $controller->GetAllControllerRequests('FORM');
        if (empty($formvars['inDomain']) || empty($formvars['inName']) || empty($formvars['inAddress']) || empty($formvars['inCity']) || empty($formvars['inCountry'])) {
        self::$empty = true;
        return false; }
       if (self::ExecuteMakeSSL($formvars['inDomain'], $formvars['inName'], $formvars['inAddress'], $formvars['inCity'], $formvars['inCountry']))
       return true;
   }

    static function doMakeCSR()
   {
       global $controller;
       runtime_csfr::Protect();
       $currentuser = ctrl_users::GetUserDetail();
       $formvars = $controller->GetAllControllerRequests('FORM');
        if (empty($formvars['inDomain']) || empty($formvars['inName']) || empty($formvars['inAddress']) || empty($formvars['inCity']) || empty($formvars['inCountry']) || empty($formvars['inCompany']) || empty($formvars['inDepartment'])) {
        self::$empty = true;
        return false; }
       if (self::ExecuteCSR($formvars['inDomain'], $formvars['inName'], $formvars['inAddress'], $formvars['inCity'], $formvars['inCountry'], $formvars['inCompany'], $formvars['inDepartment']))
       return true;
   }    
    
    static function doDeleteSSL()
    {
        global $controller;
        runtime_csfr::Protect();
        $currentuser = ctrl_users::GetUserDetail();
        $formvars = $controller->GetAllControllerRequests('FORM');
        if (self::ExecuteDeleteSSL($formvars['inName'], $currentuser["username"]))
        return true;
   }
    
    static function getSSLList()
    {
        $currentuser = ctrl_users::GetUserDetail();
        return self::ListSSL($currentuser['username']);
    }
    
    static function getDomainList()
    {
        $currentuser = ctrl_users::GetUserDetail();
        return self::ListDomains($currentuser['userid']);
    }
    
    static function getCountryList()
    {
        $res = '<option value="AX"> Aland Islands </option><option value="AD"> Andorra </option><option value="AE"> United Arab Emirates </option>option value="AF"> Afghanistan </option><option value="AG"> Antigua and Barbuda </option><option value="AI"> Anguilla </option><option value="AL"> Albania </option><option value="AM"> Armenia </option><option value="AN"> Netherlands Antilles </option><option value="AO"> Angola </option><option value="AQ"> Antarctica </option><option value="AR"> Argentina </option><option value="AS"> American Samoa </option><option value="AT"> Austria </option><option value="AU"> Australia </option><option value="AW"> Aruba </option><option value="AZ"> Azerbaijan </option><option value="BA"> Bosnia and Herzegovina </option><option value="BB"> Barbados </option><option value="BD"> Bangladesh </option><option value="BE"> Belgium </option><option value="BF"> Burkina Faso </option><option value="BG"> Bulgaria </option><option value="BH"> Bahrain </option><option value="BI"> Burundi </option><option value="BJ"> Benin </option><option value="BM"> Bermuda </option><option value="BN"> Brunei Darussalam </option><option value="BO"> Bolivia </option><option value="BR"> Brazil </option><option value="BS"> Bahamas </option><option value="BT"> Bhutan </option><option value="BV"> Bouvet Island </option><option value="BW"> Botswana </option><option value="BZ"> Belize </option><option value="CA"> Canada </option><option value="CC"> Cocos Islands </option><option value="CF"> Central African Republic </option><option value="CH"> Switzerland </option><option value="CI"> Cote D\'Ivoire </option><option value="CK"> Cook Islands </option><option value="CL"> Chile </option><option value="CM"> Cameroon </option><option value="CN"> China </option><option value="CO"> Colombia </option><option value="CR"> Costa Rica </option><option value="CS"> Czechoslovakia </option><option value="CV"> Cape Verde </option><option value="CX"> Christmas Island </option><option value="CY"> Cyprus </option><option value="CZ"> Czech Republic </option><option value="DE"> Germany </option><option value="DJ"> Djibouti </option><option value="DK"> Denmark </option><option value="DM"> Dominica </option><option value="DO"> Dominican Republic </option><option value="DZ"> Algeria </option><option value="EC"> Ecuador </option><option value="EE"> Estonia </option><option value="EG"> Egypt </option><option value="EH"> Western Sahara </option><option value="ER"> Eritrea </option><option value="ES"> Spain </option><option value="ET"> Ethiopia </option><option value="FI"> Finland </option><option value="FJ"> Fiji </option><option value="FK"> Falkland Islands </option><option value="FM"> Micronesia </option><option value="FO"> Faroe Islands </option><option value="FR"> France </option><option value="FX"> France, Metropolitan </option><option value="GA"> Gabon </option><option value="GB"> Great Britain (UK) </option><option value="GD"> Grenada </option><option value="GE"> Georgia </option><option value="GF"> French Guiana </option><option value="GG"> Guernsey </option><option value="GH"> Ghana </option><option value="GI"> Gibraltar </option><option value="GL"> Greenland </option><option value="GM"> Gambia </option><option value="GN"> Guinea </option><option value="GP"> Guadeloupe </option><option value="GQ"> Equatorial Guinea </option><option value="GR"> Greece </option><option value="GT"> Guatemala </option><option value="GU"> Guam </option><option value="GW"> Guinea-Bissau </option><option value="GY"> Guyana </option><option value="HK"> Hong Kong </option><option value="HN"> Honduras </option><option value="HR"> Croatia (Hrvatska) </option><option value="HT"> Haiti </option><option value="HU"> Hungary </option><option value="ID"> Indonesia </option><option value="IE">Ireland </option><option value="IL"> Israel </option><option value="IM"> Isle of Man </option><option value="IN"> India </option><option value="IS"> Iceland </option><option value="IT"> Italy </option><option value="JE"> Jersey </option><option value="JM"> Jamaica </option><option value="JO"> Jordan </option><option value="JP"> Japan </option><option value="KE"> Kenya </option><option value="KG"> Kyrgyzstan </option><option value="KH"> Cambodia </option><option value="KI"> Kiribati </option><option value="KM"> Comoros </option><option value="KN"> Saint Kitts and Nevis </option><option value="KR"> Korea (South) </option><option value="KW"> Kuwait </option><option value="KY"> Cayman Islands </option><option value="KZ"> Kazakhstan </option><option value="LA"> Laos </option><option value="LC"> Saint Lucia </option><option value="LI"> Liechtenstein </option><option value="LK"> Sri Lanka </option><option value="LS"> Lesotho </option><option value="LT"> Lithuania </option><option value="LU"> Luxembourg </option><option value="LV"> Latvia </option><option value="LY"> Libya </option><option value="MA"> Morocco </option><option value="MC"> Monaco </option><option value="MD"> Moldova </option><option value="ME"> Montenegro </option><option value="MG"> Madagascar </option><option value="MH"> Marshall Islands </option><option value="MK"> Macedonia </option><option value="ML"> Mali </option><option value="MM"> Myanmar </option><option value="MN"> Mongolia </option><option value="MO"> Macau </option><option value="MP"> Northern Mariana Islands </option><option value="MQ"> Martinique </option><option value="MR"> Mauritania </option><option value="MS"> Montserrat </option><option value="MT"> Malta </option><option value="MU"> Mauritius </option><option value="MV"> Maldives </option><option value="MW"> Malawi </option><option value="MX"> Mexico </option><option value="MY"> Malaysia </option><option value="MZ"> Mozambique </option><option value="NA"> Namibia </option><option value="NC"> New Caledonia </option><option value="NE"> Niger </option><option value="NF"> Norfolk Island </option><option value="NG"> Nigeria </option><option value="NI"> Nicaragua </option><option value="NL"> Netherlands </option><option value="NO"> Norway </option><option value="NP"> Nepal </option><option value="NR"> Nauru </option><option value="NT"> Neutral Zone </option><option value="NU"> Niue </option><option value="NZ"> New Zealand </option><option value="OM"> Oman </option><option value="PA"> Panama </option><option value="PE"> Peru </option><option value="PF"> French Polynesia </option><option value="PG">Papua New Guinea </option><option value="PH"> Philippines </option><option value="PK"> Pakistan </option><option value="PL"> Poland </option><option value="PM"> St. Pierre and Miquelon </option><option value="PN"> Pitcairn </option><option value="PR"> Puerto Rico </option><option value="PS"> Palestinian Territory </option><option value="PT"> Portugal </option><option value="PW"> Palau </option><option value="PY"> Paraguay </option><option value="QA"> Qatar </option><option value="RE"> Reunion </option><option value="RO"> Romania </option><option value="RS"> Serbia </option><option value="RU"> Russian Federation </option><option value="RW"> Rwanda </option><option value="SA"> Saudi Arabia </option><option value="SB"> Solomon Islands </option><option value="SC"> Seychelles </option><option value="SE"> Sweden </option><option value="SG"> Singapore </option><option value="SH"> St. Helena </option><option value="SI"> Slovenia </option><option value="SK"> Slovak Republic </option><option value="SL"> Sierra Leone </option><option value="SM"> San Marino </option><option value="SN"> Senegal </option><option value="SR"> Suriname </option><option value="ST"> Sao Tome and Principe </option><option value="SU"> USSR </option><option value="SV"> El Salvador </option><option value="SZ"> Swaziland </option><option value="TC"> Turks and Caicos Islands </option><option value="TD"> Chad </option><option value="TG"> Togo </option><option value="TH"> Thailand </option><option value="TJ"> Tajikistan </option><option value="TK"> Tokelau </option><option value="TM"> Turkmenistan </option><option value="TN"> Tunisia </option><option value="TO"> Tonga </option><option value="TP"> East Timor </option><option value="TR"> Turkey </option><option value="TT"> Trinidad and Tobago </option><option value="TV"> Tuvalu </option><option value="TW"> Taiwan </option><option value="TZ"> Tanzania </option><option value="UA"> Ukraine </option><option value="UG"> Uganda </option><option value="US"> United States </option><option value="UY"> Uruguay </option><option value="UZ"> Uzbekistan </option><option value="VA"> Vatican City State</option><option value="VE"> Venezuela </option><option value="VG"> Virgin Islands </option><option value="VN"> Viet Nam </option><option value="VU"> Vanuatu </option><option value="WS"> Samoa </option><option value="YE"> Yemen </option><option value="YT"> Mayotte </option><option value="ZA"> South Africa </option><option value="ZM"> Zambia </option>';
        return $res;
    }
    
    static function getModuleName()
    {
        $module_name = ui_language::translate(ui_module::GetModuleName());
        return $module_name;
   }
    
   static function getModuleIcon()
    {
       global $controller;
       $module_icon = "modules/" . $controller->GetControllerRequest('URL', 'module') . "/assets/icon.png";
       return $module_icon;
   }

   static function getModulePath()
    {
       global $controller;
       $module_path = "modules/" . $controller->GetControllerRequest('URL', 'module') . "/";
       return $module_path;
   }

   static function getModuleDesc()
    {
       $message = ui_language::translate(ui_module::GetModuleDescription());
       return $message;
   }
    
   static function getCSFR_Tag()
    {
       return runtime_csfr::Token();
   }
    
    static function getResult()
   {
         if (self::$ok) {
           return ui_sysmessage::shout(ui_language::translate("Your SSL certificate is installed. A secure connection will be available within an hour."), "zannounceok");
       }
        if (self::$error) {
           return ui_sysmessage::shout(ui_language::translate("A certificate with that name already exists."), "zannounceerror");
       }
        if (self::$empty) {
           return ui_sysmessage::shout(ui_language::translate("An empty field is not allowed."), "zannounceerror");
       }
        if (self::$reqadd) {
           return ui_sysmessage::shout(ui_language::translate("Certificate Signing Request was made and sent to the mail you have entered."), "zannounceok");
       }
        if (self::$del) {
           return ui_sysmessage::shout(ui_language::translate("The selected certificate has been deleted."), "zannounceerror");
       }
       return;
   }
    
}

?>

i will  Work on a update that Works on Windows i hope
Sentora 1.0.3 on [Image: DO_Logo_Horizontal_Blue-3db19536.png]

-= Github =-  -= My Repo =-

My Modules
Reply
Thanks given by:


Messages In This Thread
[MODULE] Certificate Manager - by Diablo925 - 09-24-2015, 05:09 AM
RE: [Module] Certificate Manager - by TGates - 09-24-2015, 06:34 AM
RE: [Module] Certificate Manager - by MarkDark - 09-24-2015, 06:51 AM
RE: [Module] Certificate Manager - by MarkDark - 09-24-2015, 07:01 AM
RE: [Module] Certificate Manager - by TGates - 09-24-2015, 07:35 AM
RE: [Module] Certificate Manager - by Diablo925 - 09-24-2015, 02:47 PM
RE: [Module] Certificate Manager - by Diablo925 - 09-24-2015, 03:18 PM
RE: [Module] Certificate Manager - by TGates - 09-24-2015, 05:11 PM
RE: [Module] Certificate Manager - by TGates - 09-24-2015, 05:18 PM
RE: [Module] Certificate Manager - by Diablo925 - 09-24-2015, 08:30 PM
RE: [Module] Certificate Manager - by TGates - 09-25-2015, 02:59 AM
RE: [Module] Certificate Manager - by bbspike - 09-24-2015, 11:26 PM
RE: [Module] Certificate Manager - by Diablo925 - 09-25-2015, 03:48 AM
RE: [Module] Certificate Manager - by kandrews - 09-25-2015, 07:25 AM
RE: [Module] Certificate Manager - by Diablo925 - 10-03-2015, 09:55 PM
RE: [Module] Certificate Manager - by Diablo925 - 10-04-2015, 12:56 AM
RE: [Module] Certificate Manager - by MarkDark - 10-09-2015, 07:09 PM
RE: [Module] Certificate Manager - by Diablo925 - 10-09-2015, 07:44 PM
RE: [Module] Certificate Manager - by TGates - 10-10-2015, 03:34 AM
RE: [Module] Certificate Manager - by Diablo925 - 10-10-2015, 03:52 AM
RE: [Module] Certificate Manager - by MarkDark - 10-10-2015, 06:44 AM
RE: [Module] Certificate Manager - by Diablo925 - 10-10-2015, 06:53 AM
RE: [Module] Certificate Manager - by MarkDark - 10-10-2015, 03:19 PM
RE: [Module] Certificate Manager - by Diablo925 - 10-11-2015, 11:31 PM
RE: [Module] Certificate Manager - by Diablo925 - 10-11-2015, 11:38 PM
RE: [Module] Certificate Manager - by Diablo925 - 10-21-2015, 11:05 PM
RE: [Module] Certificate Manager - by TGates - 10-22-2015, 05:35 AM
RE: [Module] Certificate Manager - by Diablo925 - 10-22-2015, 09:44 PM
RE: [Module] Certificate Manager - by eseelke - 11-12-2015, 10:25 AM
RE: [Module] Certificate Manager - by Diablo925 - 11-12-2015, 03:44 PM
RE: [Module] Certificate Manager - by bbspike - 11-13-2015, 06:50 AM
RE: [Module] Certificate Manager - by TGates - 11-13-2015, 02:54 PM
RE: [Module] Certificate Manager - by Diablo925 - 11-15-2015, 04:39 AM
RE: [Module] Certificate Manager - by bbspike - 11-26-2015, 06:40 PM
RE: [Module] Certificate Manager - by TGates - 11-27-2015, 04:02 AM
RE: [Module] Certificate Manager - by bbspike - 11-27-2015, 07:20 AM
RE: [Module] Certificate Manager - by Diablo925 - 11-27-2015, 05:54 PM
RE: [Module] Certificate Manager - by bbspike - 11-27-2015, 07:32 PM
RE: [Module] Certificate Manager - by TGates - 11-28-2015, 09:55 AM
RE: [Module] Certificate Manager - by bbspike - 11-29-2015, 04:07 AM
RE: [Module] Certificate Manager - by bbspike - 11-29-2015, 05:22 AM
RE: [Module] Certificate Manager - by JonathanNet - 12-15-2015, 08:04 AM
RE: [Module] Certificate Manager - by iraqiboy90 - 12-18-2015, 12:37 PM
RE: [Module] Certificate Manager - by culunsure - 12-30-2015, 07:44 PM
RE: [Module] Certificate Manager - by Jakeey802 - 12-31-2015, 09:32 AM
RE: [Module] Certificate Manager - by AgentD - 01-03-2016, 10:11 AM
RE: [Module] Certificate Manager - by Diablo925 - 01-09-2016, 05:26 AM
RE: [Module] Certificate Manager - by TGates - 01-09-2016, 05:46 AM
RE: [Module] Certificate Manager - by TGates - 01-09-2016, 06:31 AM
RE: [Module] Certificate Manager - by AgentD - 01-12-2016, 06:20 PM
RE: [Module] Certificate Manager - by bbspike - 01-12-2016, 10:20 PM
RE: [Module] Certificate Manager - by AgentD - 01-13-2016, 08:31 AM
RE: [Module] Certificate Manager - by Josvdwoude - 01-16-2016, 04:41 AM
RE: [Module] Certificate Manager - by Delbane - 03-19-2016, 09:45 AM
RE: [Module] Certificate Manager - by wishmaster - 05-05-2016, 04:52 AM
RE: [Module] Certificate Manager - by eirsik - 06-20-2016, 08:35 PM
RE: [Module] Certificate Manager - by Ron-e - 06-21-2016, 04:48 AM
RE: [Module] Certificate Manager - by eirsik - 06-21-2016, 10:27 PM
RE: [Module] Certificate Manager - by Ron-e - 06-22-2016, 12:17 AM
RE: [Module] Certificate Manager - by Unknown - 06-24-2016, 07:01 PM
RE: [Module] Certificate Manager - by Rynoxx - 06-27-2016, 12:15 AM
RE: [Module] Certificate Manager - by Ron-e - 06-28-2016, 12:32 AM
[MODULE] Certificate Manager - by donleo123 - 06-04-2018, 10:40 AM
RE: [MODULE] Certificate Manager - by longhb - 07-05-2018, 11:56 AM
RE: [MODULE] Certificate Manager - by mungujakisa - 08-07-2018, 06:31 AM
RE: [MODULE] Certificate Manager - by TGates - 07-17-2018, 05:15 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
[Module] Let's Encrypt Bizarrus 50 19 492 05-24-2020, 03:44 PM
Last Post: muratkaragoz
[Module] Pydio jollyjoke 51 69 866 02-04-2020, 04:45 PM
Last Post: jollyjoke
[Module] Manage Categories jollyjoke 2 4 008 02-03-2020, 02:02 AM
Last Post: jollyjoke

Forum Jump:


Users browsing this thread: 1 Guest(s)