CHips L MINI SHELL

CHips L pro

Current Path : /opt/cpanel/ea-php54/root/usr/share/pear/RVSeagullMod/lib/RVSGL/CpHandle/
Upload File :
Current File : //opt/cpanel/ea-php54/root/usr/share/pear/RVSeagullMod/lib/RVSGL/CpHandle/TryoutUser.php

<?php
require_once dirname(__FILE__) . '/InterfaceForUser.php';
require_once dirname(__FILE__) . '/TryoutLibs.php';

class CpHandle_TryoutUser extends CpHandle_TryoutLibs implements CpHandle_InterfaceForUser
{
    public function CpHandle_TryoutUser()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	parent::SGL_Manager();
    }

    public function init()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    }

    public function getLogoutUrl()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return '/user/login/action/logout/';
    }

    public function definedModulePathConfig($moduleName)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return  SGL_VAR_DIR . '/config/' .$moduleName.'.ini';
    }

    public function setCookieAndRedirect()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return true;

    }

    public function detectPathPHP()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return false;
    }

    public function isValidBuyAccountUrl()
    {
		SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return true;
    }

	public function doAddCronJob()
	{
		SGL::logMessage(null, PEAR_LOG_DEBUG);
		return "";
	}

    public function getUrlBackToTryout()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return '/user/login/action/backToTryout/';
    }

    public function isValidClearCacheAndRVSiteFIX()
    {
		SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return false;
    }

    public function isValidIncludeFileLang($aConfTemplateList)
    {
       	return  isset($aConfTemplateList['tryoutlogin']['subdomain_path']) ? true : false;
    }

    public function isNotTryout()
    {
		//log loop SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    public function isLicenseValid()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return true;
    }

    public function isVaildTemplatePrivate()
    {
		//SGL::logMessage(null, PEAR_LOG_DEBUG);
        return true;
    }

    public function isValidDataHomeReplace($data)
    {
		SGL::logMessage(null, PEAR_LOG_DEBUG);
        return preg_match('/3rdparty/', $data) ? true :false;
    }

    public function actionAJExternal($url)
    {
		SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    /**
    * no process in nocp
    * tryout return true
    */
    public function isRecordPublishProject()
    {
		SGL::logMessage(null, PEAR_LOG_DEBUG);
        return true;
    }

    /**
    * no process in cpanel
    * tryout return true
    */
    public function isValidTemplateItemPath($templateUserId, $templateItemFolder)
    {
		SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return true;
    }

    public function getPathPHPsuexec()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        if (isset($this->conf['SiteBuilder']['modPhpSuExec'])
        && $this->conf['SiteBuilder']['modPhpSuExec'] == 1
        && is_dir(SGL_PATH . '/phpsuexec')) {
            return RVSITEBUILDER_URL . '/phpsuexec';
        }
        return false;
    }

    public function getProjectDbMissing($userID)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	require_once dirname(dirname(__FILE__)) . '/RestoreProjectDbMissingMgr.php';
        $oRestorePj = new RestoreProjectDbMissingMgr();
        $aProjectNotInDb = $oRestorePj->getProjectNotInDbByUserId($userID, REAL_PROJECT_PATH);
        return $aProjectNotInDb;
    }

    public function isAllowExportProject()
    {
    	return isset($this->conf['Admin']['Owner']['AllowExportProjectTryout'])
    		? $this->conf['Admin']['Owner']['AllowExportProjectTryout']
    		: 0;
    }

    public function isAllowImportProject()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return isset($this->conf['Admin']['Owner']['AllowImportProjectTryout'])
	    	? $this->conf['Admin']['Owner']['AllowImportProjectTryout']
	    	: 0;
    }

    public function getHomeDir($username=RVS_USER_NAME)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return RVS_USER_HOME;
    }

    public function getCPDATA($username=RVS_USER_NAME)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    }

    public function getUserDNS($all=0)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	if ($all == 1) {
    		$aDNS = array();
    		foreach ($GLOBALS['NOCP']['CPDATA'] as $key=>$val) {
    			if (RvsLibs_String::preg_match('/^DNS/',$key,$match)) {
    				$aDNS[$key] = $val;
    			}
    		}
    		return $aDNS;
    	} else {
    		return $GLOBALS['NOCP']['CPDATA']['DNS'];
    	}
    }

    public function getRealDIRbyDomain($domain)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	$subDomainPath['DIR'] = RVS_USER_HOME;
    	return $subDomainPath;
    }

    public function getDatabaseInfomation()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);

    }

    public function doCreateDatabase($dbname)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);

    }

    public function doCreateDatabaseUser($username, $passwd)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);

    }

    public function doAddDBUser($dbname, $username)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);

    }

    public function doDeleteDatabase($dbname)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);

    }

    public function doDeleteDatabaseUser($username)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);

    }

    /**
     * input $dbname
     * check prefix and add prefix , return new dbname have prefix
     */
    public function getRealFormatDBName($dbName)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return $dbName;
    }

    public function getMaxUserQuota()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);

    }

    public function getUserQuota()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    }

	public function getDocroot()
	{
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return $_SERVER['DOCUMENT_ROOT'];
	}

	public function getCpUserInfo()
	{
	    SGL::logMessage(null, PEAR_LOG_DEBUG);
	    $oCpData->quotaused = 100;
	    $oCpData->maxquota = 'unlimited';
	    $oCpData->docroot = $_SERVER['DOCUMENT_ROOT'];
        return $oCpData;
	}

    /**
     * This function process in tryout mode.
     * @author siwakorn@rvglobalsoft.com
     * @param $isPhpSuExec ( 0/1 )
     * @return <true>/<false>
     */
    public function changePermissionRVSPreview($isPhpSuExec)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
        return ($isPhpSuExec == 1) ? true : false;
    }

    public function registerButtonOnlineCounter()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return false;
    }

    /**
     * Make folder component in scripts project path.
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @param String $pathComponentName
     * @return Boolean True
     */
    public function makeFolderComponent($pathComponentName = null)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return true;
    }

    public function isDisableBlogComponent($aTestOption = array())
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return 1;
    }

    public function getDatabaseEditURL()
    {
		SGL::logMessage(null, PEAR_LOG_DEBUG);
    }

    public function getTmpPath()
    {
    	return '/tmp';
    	$tmp = (RVS_IS_ADMIN == 1)
            ? RvsLibs_File::buildPath(array(RVS_USER_HOME, '.rvsitebuilder', 'tmp'))
            : RvsLibs_File::buildPath(array(RVS_USER_HOME, 'tmp'));
    	SGL::logMessage($tmp, PEAR_LOG_DEBUG);
    	return $tmp;
    }

    public function skipValidTemplate()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return true;
    }

    public function getTemplatePathUrl($action='edit', $aTemplateOption=array())
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
        if (count($aTemplateOption)
        && (RvsLibs_Template::isValidTemplate($aTemplateOption['templateUserId'], $aTemplateOption['templateItemFolder']) )) {
            $aTemplatePathUrl = ($action == 'edit')
                               ? RvsLibs_Template::getImportedTemplatePathUrlAdmin()
                               : RvsLibs_Template::getImportedTemplatePathUrlUser($aTemplateOption['templateUserId']);
        } else {
            $aTemplatePathUrl['path'] = TEMPLATE_PATH;
            $aTemplatePathUrl['url'] = TEMPLATE_URL;
        }
        return $aTemplatePathUrl;
    }

    public function getTypeFileEncode($fileName)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	$TypeFileEncode = '';
    	if (RvsLibs_System::function_exists('finfo_open') && RvsLibs_System::function_exists('finfo_file')) {
    		$finfo = @finfo_open(FILEINFO_MIME_ENCODING);
    		$TypeFileEncode = @finfo_file($finfo, $fileName);
    	}
    	return $TypeFileEncode;
    }

    public function replaceRelativeURL()
    {
       SGL::logMessage(null, PEAR_LOG_DEBUG);
       return RvsLibs_String::str_replace('/' . PROGRAM_NAME, '', RVSITEBUILDER_URL);
    }

    public function isMinRvsOK($versionExport)
    {
        SGL::logMessage("RVSiteBuilder Export version:: " . $versionExport, PEAR_LOG_DEBUG);
        return RvsLibs_License::siteBuilderVersion($versionExport);
    }

	public function checkFileConfigLicenseCycle($cycleNow = 0, $errorNotExit = 0, $skipMsg = 0)
	{
	    SGL::logMessage(null, PEAR_LOG_DEBUG);
	    require_once dirname(dirname(__FILE__)) . '/LicenseCycle.php';
	    $oCycle = new LicenseCycle();
	    $oCycle->FileConfigLicenseCycle($cycleNow, $errorNotExit, $skipMsg);
	    return true;
	}

	/*
    public function getControlPanelUrl()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return INDEX_URL . '/sitebuilder';
    }
	*/
    /**
     * For process in cp mode
     * check counter is existing and make new counter.
     * @param $defCounterName <string> counter name
     * @author pharadol@rvglobalsoft.com
     */
    public function getNewCounterExisting($counterName)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    public function validateCounterNameExisting($counterName)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return  false;
    }

    public function validateChangeCounterName($counterName)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return  true;
    }

    public function runUpdateFileCounterData($filePreview, $cpanelTagPreview, $counterName, $newCounter)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return true;
    }

    #File:Online_CounterMgr
    public function runUpdateCounterData($cpanelTag, $counterName, $newCounter)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
        return  '';
    }

    public function cpanelHtmlTagCounter($counterTag)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    public function tryoutGetBuyAccountUrl()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
        require_once  dirname(dirname(__FILE__)). '/Output.php';
        $oDataOutput = new SitebuilderOutput();
        return $oDataOutput->getBuyAccountUrl();
    }

    public function createNewEmailcpSecurity()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    public function runDetectPhpSuexec($phpSuexec)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        //fix return 0
        return 0;
    }

    public function replateAtOnUserName($userName)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return RvsLibs_String::str_replace('@', '-AT-', $userName);
    }

	public function isCpanel()
	{
        SGL::logMessage(null, PEAR_LOG_DEBUG);
	    return false;
	}

    public function isSkipAllowUserPerms()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return true;
    }

    public function getPathQuotaUser($aPath)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return '';
    }

    public function getFileManagerUrlByUser($username)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
        return '';
    }

    /**
     * Get path image diy in mode wysiwyg
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @param String $pathImg
     * @return String Path image diy in mode wysiwyg
     */
    public function getPathImgWysDiy($pathImg = null)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return RvsLibs_File::buildPath(array(RvsLibs_String::preg_replace('/\/public_html\/(.*?)$/i', '', RVS_USER_HOME), 'public_html', $pathImg));
    }

    /**
     * Validate create project on mode.
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return Boolean True
     */
    public function isValidCreateProject()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return true;
    }

    /**
     * Validate get html tag counter
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return Boolean False
     */
    public function isValidHtmlTagCounter()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    /**
     * Validate update rollback version
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return Boolean False
     */
    public function isValidUpdateRollbackVersion()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    /**
     * Validate phpsu in XML
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return Boolean False
     */
    public function isValidPhpsuModeXml()
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    /**
     * Validate component db on mode
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return Boolean False
     */
    public function isValidCompoDbMode()
    {
        return false;
    }

    /**
     * Get url for edit database
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return String
     */
    public function getUrlDb()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return '';
    }

    /**
     * Validate component db on flexy
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return Boolean True
     */
    public function isValidCompoDbFlexy()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return true;
    }

    /**
     * Is mode tryout
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return Boolean True
     */
    public function isTryout()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return true;
    }

    /**
     * Is mode nocp
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return Boolean False
     */
    public function isNocp()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

     /**
     * Make update tryout
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @return String null
     */
    public function makeUpdateTryout()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return null;
    }

        /**
     * Make update tryout login config
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @param Boolean $isAutoApproval
     * @param String null
     */
    public function makeUpdateTryoutLoginConf($isAutoApproval = false, $subdomainPath = null)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return null;
    }

     /**
     * Make remove tryout
     *
     * @author Puttipong <puttipong@rvglobalsoft.com>
     * @param String null
     */
    public function makeRemoveTryout($option = array())
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return null;
    }

    public function replacePreviewOnlineCounter($cpanelCounterTag)
    {
       SGL::logMessage(null, PEAR_LOG_DEBUG);
       $publishUrl = 'http://' . RvsLibs_User::getUserDNS();
       return RvsLibs_String::preg_replace('/\/cgi\-sys\/Count\.cgi/', $publishUrl . '/cgi-sys/Count.cgi', $cpanelCounterTag);
    }

    public function isDirectAdmin()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

    public function getRvBinPath()
    {
        $rvspath = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/rvbin/rvswrapper';
        SGL::logMessage($rvspath, PEAR_LOG_DEBUG);
        return $rvspath;
    }

    public function isAdmin($username = RVS_USER_NAME)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return ($username == 'root')? true : false;

    }

    public function ownerIsAdmin($ownername = RVS_OWNER_USER_NAME)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	return ($ownername == 'root')? true : false;
    }

     public function createAutoDatabase($buildDBName, $buildDBUsername, $buildDBPasswd)
    {
         SGL::logMessage(null, PEAR_LOG_DEBUG);
         /*$dbname = (defined('DATABASE_PREFIX') && DATABASE_PREFIX === false) ? RVS_USER_NAME . $buildDBName : $buildDBName;
         $isOk = $this->doCreateDatabase($dbname);
         if (SGL::isError($isOk)) {
            SGL_Error::pop();
            return false;
         }

        $username = (defined('DATABASE_PREFIX') && DATABASE_PREFIX === false) ? RVS_USER_NAME . $buildDBUsername : $buildDBUsername;
        $isOk = $this->doCreateDatabaseUser($username, $buildDBPasswd);
        if (SGL::isError($isOk)) {
            SGL_Error::pop();
            $aDatabase = $this->doDeleteDatabase($buildDBName);
            $this->getDataResponse($aDatabase);
            return false;
        }

         $isOk = $this->doAddDBUser($this->getRealFormatDBName($buildDBName), $this->getRealFormatDBName($buildDBUsername));
         if (SGL::isError($isOk)) {
            SGL_Error::pop();
            $aData = $this->doDeleteDatabase($buildDBName);
            $this->getDataResponse($aData);

            $aDatabaseUser = $this->doDeleteDatabaseUser($buildDBUsername);
            $this->getDataResponse($aDatabaseUser);
            return false;
         }*/
    }

    function secureCommandMakeLinkProjectId($projectId)
    {
    	SGL::logMessage(null, PEAR_LOG_DEBUG);
    	$resSecure = RvsLibs_System::secureCommand('makeprojectsymlink', array('project-id' => $projectId));
    	if (SGL::isError($resSecure) === true) {
    		return SGL::raiseError(
    		    RvsLibs_String::translate(
                      'Cannot create project folder symlink, becase %MSG.'
                      , 'vprintf'
                      , array('MSG' => $resSecure->getMessage())
                )
            );
    	}
    	return true;
    }

   public function makeUploadFolder($userUploadPath, $pathRootUpload, $rootPath)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        return false;
    }

   public function createUserSymlinkUserFolder($pathUserUpload, $pathUploadLink)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        RvsLibs_User::createUserSymlinkUserFolder($pathUserUpload, $pathUploadLink);
    }

   public function isUploadedFile($tempFile)
   {
    SGL::logMessage(null, PEAR_LOG_DEBUG);
    return RvsLibs_File::isUploadedFile($tempFile);
   }


   public function moveUploadedFile($tempFile, $destination)
   {
    SGL::logMessage(null, PEAR_LOG_DEBUG);
    return RvsLibs_File::moveUploadedFile($tempFile, $destination);
   }

   public function makeLink($source, $des)
   {
   	SGL::logMessage('tempFile :: ' . $source, PEAR_LOG_DEBUG);
   	SGL::logMessage('destination::' . $des, PEAR_LOG_DEBUG);
   	RvsLibs_System::ln(array('-s', $source, $des));
   }

   public function msgWaringOpenBaseDir()
   {
   	SGL::logMessage(null, PEAR_LOG_DEBUG);
   	return RvsLibs_String::translate('userda contact provider to update virtualhost');
   }

    public function buildProjectUrlForDa()
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
    }

    public function createLinkFolder($fullPath, $fileZip)
    {
        SGL::logMessage("createLinkFolder >>>>>>>>>>>>> " . $fullPath . $fileZip, PEAR_LOG_DEBUG);
        $fileNameZip = preg_replace('/(\.tar\.gz$|\.gz$|\.tar$|\.zip$)/i', '', $fileZip);
        $FName = urlencode($fileNameZip);
        if (file_exists($fullPath . $fileNameZip)) {
            self::makeLink($fullPath . $fileNameZip, $fullPath . $FName);
        }
    }

    public function createLinkFileAndFolder($fullPath)
    {
    	//file image
    	$allFile = RvsLibs_System::ls($fullPath);
    	foreach ($allFile['files'] as $k => $v) {
    		$image = end(RvsLibs_String::dbeExplode('/', $v));
    		$fileName = urlencode($image);
    		if (preg_match('/\.gif$|\.png$|\.jpg$|\.jpeg$/i',$fileName, $match)) {
    			if (is_link($fullPath . $fileName) === false) {
    				self::makeLink($fullPath . $image, $fullPath . $fileName);
    			}
    		}
    	}
    	//folder
    	foreach ($allFile['dirs'] as $key => $val ) {
    		//เช็คว่าถ้าอัพโหลดไฟล์รูปจะไม่ให้เข้ามาทำงานในส่วนนี้
    		if (realpath($fullPath) != $val) {
    			$folder= end(RvsLibs_String::dbeExplode('/', $val));
    			$dirName = urlencode($folder);
    			if (RvsLibs_File::_isEncode($dirName) === true) {
    				if (is_link($fullPath . $dirName) === false) {
    					//RvsLibs_System::ln(array('-s', $fullPath . $folder, $fullPath . $dirName));
    					self::makeLink($fullPath . $folder, $fullPath . $dirName);
    					$aFile = RvsLibs_System::ls(array('-a', '-R', '-C', $fullPath . $folder));
    					foreach($aFile['files'] as $k => $v) {
    						$file= end(RvsLibs_String::dbeExplode('/', $v));
    						$fName = urlencode($file);
    						$encodeFile = str_replace($file, $fName, $v);
    						self::makeLink($v, $encodeFile);
    					}
    				}
    			}
    		}
    	}
    }

    public function makeFolderLink($fullPath, $folderName)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        RvsLibs_File::makeFolderLink($fullPath, $folderName);
    }

    public function makeImageLink($fullPath, $filename)
    {
        SGL::logMessage(null, PEAR_LOG_DEBUG);
        RvsLibs_File::makeImageLink($fullPath, $filename);
    }

    public function isRealConfigUpLoadMaxFileSize()
    {
        return ini_get('upload_max_filesize');
    }

    /**
     * Make userdata path
     * @return unknown_type
     */
    function makeuserdatapath($userdataPath)
    {
    	return RvsLibs_System::mkDir(array('-p', '-m', 0755, $userdataPath));
    }

    function replaceUrlToNobase($data) {
    	return RvsLibs_Project::replaceDaToNobase($data);

    }

    function makeFileQuota($dnsPublish)
    {
    	return true;
    }

    public function getPublishMsgHttps($domain = '')
    {
    	$domain = ($domain != '') ? $domain : 'domain';
    	return RvsLibs_String::translate('Please make sure your %DOMAIN can be called as https://.'
    			, 'vprintf'
    			, array('DOMAIN' => $domain)
    	);
    }

    public function detectCpanelProxyMsg()
    {
    	return false;
    }

    /**
     *
     * Make Restore Online Counter
     *
     * @author Puttipong <puttipong at rvglobalsoft.com>
     *
     * @param $projectId <STRING>
     * @return TRUE
     */
    public function makeRestoreOnlineCounter($projectId=null) {
        return true;
    }

    public function getMySQLVersion()
    {
    	return isset($_SESSION['_MySQLVersion']) ? $_SESSION['_MySQLVersion'] : 'unknow';
    }

    //phpversion
    public function getPHPVersion()
    {
    	if (function_exists('getPHPVersion')) {
    		return getPHPVersion();
    	}
    	return 'unknow';
    }

    public function getPerlVersion()
    {
    	return isset($_SESSION['_PerlVersion']) ? $_SESSION['_PerlVersion'] : 'unknow';
    }


    public function getPhpHandler()
    {
    	if (! isset($_SESSION['_PhpHandler'])) {
    		RvsLibs_System::exec('/usr/local/cpanel/bin/rebuild_phpconf --current', $lines);
    		$phpConf = array();
    		foreach ($lines as $line_num => $line) {
    			if (RvsLibs_String::preg_match('#^Available handlers:(.*?)$#si', $line, $aMatch)) {
    				foreach(explode(' ', $aMatch[1]) as $v) {
    					$v = RvsLibs_String::trim($v);
    					if ($v != '') {
    						$phpConf['handlers'][] = $v;
    					}
    				}
    			} else if (RvsLibs_String::preg_match('#^DEFAULT PHP:(.*?)$#si', $line, $aMatch)) {
    				//$phpConf['default-ver'] = "5";
    				$phpConf['default-ver'] = RvsLibs_String::trim($aMatch[1]);
    			} else if (RvsLibs_String::preg_match('#^PHP(.*?) SAPI:(.*?)$#si', $line, $aMatch)) {
    				//$phpConf['SAPI'][5] = "suphp";
    				$phpConf['SAPI'][RvsLibs_String::trim($aMatch[1])] = RvsLibs_String::trim($aMatch[2]);
    			} else if (RvsLibs_String::preg_match('#^SUEXEC:(.*?)$#si', $line, $aMatch)) {
    				//$phpConf['suexec'] = "enabled" or "disable";
    				$phpConf['suexec'] = RvsLibs_String::trim($aMatch[1]);
    			}
    		}

    		if (count($phpConf) <= 0) {
		    	$phpConf = array();
		    	$phpConf['suexec'] = "disable";
		    	$phpConf['default-ver'] = "5";
		    	$phpConf['SAPI']['5'] = "suphp";
    		}
    		$_SESSION['_PhpHandler'] = $phpConf;
    	}
    	return $_SESSION['_PhpHandler'];
    }

    public function getCPVersion()
    {
    	if (function_exists('php_uname')) {
    		$version = php_uname('s').' - '.php_uname('r');
    	} elseif (function_exists('posix_uname')) {
    		$aVersion = posix_uname();
    		$version = $aVersion['sysname'].' - '.$aVersion['release'];
    	}

    	return isset($version) ? $version : 'Unknown';
    }

    /**
     * Tryout explode _ and return all character
     * User12345678_xxxx
     *
     * return User12345678
     *
     * (non-PHPdoc)
     * @see CpHandle_InterfaceForUser::getDBMinChaName()
     */
    public function getDBMinChaName($name = '')
    {
    	SGL::logMessage("debug before: " . $name, PEAR_LOG_DEBUG);
    	return $name;
    }

    public function getServerSoftwareInfo()
    {
    	$info = array('software' => 'tryout', 'version' => '1.0.0');
    	return $info;
    }
}
?>

Copyright 2K16 - 2K18 Indonesian Hacker Rulez