コード例 #1
0
ファイル: DaemonCoreCommon.php プロジェクト: gOOvER/EasySCP
 protected static function checkAllDataHTAccess()
 {
     /*
     $sql_query = "
     	SELECT
     		d.domain_id,
     		h. *
     	FROM
     		domain d,
     		htaccess_groups h
     	WHERE
     		d.domain_id = h.dmn_id
     	AND
     		h.status
     	IN
     		('add', 'change', 'delete')
     	ORDER BY
     		dmn_id;
     ";
     */
     $sql_query = "\n\t\t\tSELECT\n\t\t\t\tdmn_id\n\t\t\tFROM\n\t\t\t\thtaccess h\n\t\t\tWHERE\n\t\t\t\th.status <> 'ok'\n\t\t\tUNION\n\t\t\tSELECT\n\t\t\t\tdmn_id\n\t\t\tFROM\n\t\t\t\thtaccess_groups hg\n\t\t\tWHERE\n\t\t\t\thg.status <> 'ok'\n\t\t\tUNION\n\t\t\tSELECT\n\t\t\t\tdmn_id\n\t\t\tFROM\n\t\t\t\thtaccess_users hu\n\t\t\tWHERE\n\t\t\t\thu.status <> 'ok'\n\t\t\tORDER BY\n\t\t\t\tdmn_id;\n\t\t";
     foreach (DB::query($sql_query) as $row) {
         $retVal = DaemonDomain::Start('htaccess ' . $row['dmn_id'], false);
         if ($retVal !== true) {
             return $retVal;
         }
     }
     return true;
 }
コード例 #2
0
ファイル: DaemonCore.php プロジェクト: gOOvER/EasySCP
 /**
  * Checks all data eg. Domain, Mail.
  *
  * @return boolean
  */
 private static function checkAllData()
 {
     System_Daemon::debug('Starting "checkAllData" subprocess.');
     $retVal = self::checkAllDataDomain();
     if ($retVal !== true) {
         $msg = 'Checking of domains failed';
         System_Daemon::debug($msg);
         return $msg . '<br />' . $retVal;
     }
     $retVal = self::checkAllDataAlias();
     if ($retVal !== true) {
         $msg = 'Checking of alias failed';
         System_Daemon::debug($msg);
         return $msg . '<br />' . $retVal;
     }
     $retVal = self::checkAllDataMail();
     if ($retVal !== true) {
         $msg = 'Checking of mail accounts failed';
         System_Daemon::debug($msg);
         return $msg . '<br />' . $retVal;
     }
     $retVal = self::checkAllDataHTAccess();
     if ($retVal !== true) {
         $msg = 'Checking of htaccess related data failed';
         System_Daemon::debug($msg);
         return $msg . '<br />' . $retVal;
     }
     // Fake aufruf um den Apache neu zu starten
     $retVal = DaemonDomain::Start('reload', true);
     if ($retVal !== true) {
         return $retVal;
     }
     System_Daemon::debug('Finished "checkAllData" subprocess.');
     return $retVal;
 }