Exemplo n.º 1
0
 function setGlobalErrorAndWriteLog()
 {
     if (strlen($this->error) > 0) {
         CAdminPanel::Log('POP3 Error: ' . trim($this->error));
     }
 }
Exemplo n.º 2
0
 function _setSqlError($errorDesc = '')
 {
     if ($errorDesc) {
         $this->ErrorDesc = $errorDesc;
         $this->ErrorCode = 0;
     } elseif ($this->_conectionHandle) {
         $this->ErrorDesc = @odbc_errormsg($this->_conectionHandle);
         $this->ErrorCode = @odbc_error($this->_conectionHandle);
     } else {
         $this->ErrorDesc = @odbc_errormsg();
         $this->ErrorCode = @odbc_error();
     }
     if (strlen($this->ErrorDesc) > 0) {
         CAdminPanel::Log('DB ERROR < ' . trim($this->ErrorDesc));
     }
 }
Exemplo n.º 3
0
 function _setSqlError()
 {
     if ($this->_conectionHandle) {
         $this->ErrorDesc = @mysql_error($this->_conectionHandle);
         $this->ErrorCode = @mysql_errno($this->_conectionHandle);
     } else {
         $this->ErrorDesc = @mysql_error();
         $this->ErrorCode = @mysql_errno();
     }
     if (strlen($this->ErrorDesc) > 0) {
         CAdminPanel::Log('DB ERROR < ' . trim($this->ErrorDesc));
     }
 }
Exemplo n.º 4
0
 /**
  * This functiuon is to open the connection to the server
  *
  * @return bool
  */
 function open_connection()
 {
     if (!$this->_checkState_0('DISCONNECTED')) {
         return false;
     }
     if (empty($this->host) || empty($this->port)) {
         $this->error = 'Error : Either HOST or PORT is undifined!';
         return false;
     }
     $host = $this->host;
     $isSsl = strlen($host) > 6 && strtolower(substr($host, 0, 6)) == 'ssl://';
     if (function_exists('openssl_open') && ($isSsl || $this->port == 993)) {
         if (!$isSsl) {
             $host = 'ssl://' . $host;
         }
     } else {
         if ($isSsl) {
             $host = substr($host, 6);
         }
     }
     $errno = $errstr = null;
     CAdminPanel::Log('IMAP4 > Start connect to ' . $host . ':' . $this->port);
     $this->connection = @fsockopen($host, $this->port, $errno, $errstr, 10);
     if (!$this->connection) {
         $this->error = 'Could not make a connection to server , Error : ' . $errstr . ' (' . $errno . ')';
         return false;
     }
     /* set socket timeout
      * it is valid for all other functions! */
     @socket_set_timeout($this->connection, 20);
     /* socket_set_blocking($this->connection, true); */
     $this->get_line();
     $this->state = 'AUTHORIZATION';
     // $this->InitCapa();
     return true;
 }
Exemplo n.º 5
0
 /**
  * @param	string	$errorDesc
  */
 function _setError($errorDesc)
 {
     $this->_error = $this->_error ? $this->_error : $errorDesc;
     CAdminPanel::Log('XM ERROR < ' . trim($this->_error));
 }
Exemplo n.º 6
0
 function Write()
 {
     if ($this->_useLog) {
         $GLOBALS[AP_USELOG] = true;
     }
     if (!$this->IsAuth() && !$this->_isInstall) {
         if (isset($_GET['auth_error'])) {
             define('LOGIN_FORM_ERROR_MESS', '<div class="wm_login_error"><div class="wm_login_error_icon"></div><div class="wm_login_error_message" id="login_error_message">' . ap_Utils::TakePhrase('AP_LANG_LOGIN_AUTH_ERROR') . '</div></div>');
         } else {
             if (isset($_GET['sess_error'])) {
                 define('LOGIN_FORM_ERROR_MESS', '<div class="wm_login_error"><div class="wm_login_error_icon"></div><div class="wm_login_error_message" id="login_error_message">' . ap_Utils::TakePhrase('AP_LANG_LOGIN_SESS_ERROR') . '</div></div>');
             } else {
                 if (isset($_GET['access_error'])) {
                     define('LOGIN_FORM_ERROR_MESS', '<div class="wm_login_error"><div class="wm_login_error_icon"></div><div class="wm_login_error_message" id="login_error_message">' . ap_Utils::TakePhrase('AP_LANG_LOGIN_ACCESS_ERROR') . '</div></div>');
                 } else {
                     define('LOGIN_FORM_ERROR_MESS', '');
                 }
             }
         }
         $this->AddCssFile($this->AdminFolder() . '/styles/styles.css');
         include CAdminPanel::RootPath() . '/templates/login.php';
     } else {
         if ($this->_mode == 'submit' && isset($_POST) && count($_POST) > 0) {
             @ob_start();
             @$this->_disable_magic_quotes_gpc();
             $_ref = '?root';
             foreach ($this->_main as $_main) {
                 $_newref = $_main->WriteAction();
                 if ($_newref) {
                     $_ref = $_newref;
                 }
                 if ($this->HasError()) {
                     break;
                 }
             }
             if ($this->PType() && isset($GLOBALS[AP_GLOBAL_USERFILTER_HREFS]) && is_array($GLOBALS[AP_GLOBAL_USERFILTER_HREFS])) {
                 $_ref = '?tab=users&filter=' . urlencode(implode(AP_UIDS_DELIMITER, $GLOBALS[AP_GLOBAL_USERFILTER_HREFS]));
             }
             /* if (!$this->_isInstall) { $_SESSION[AP_SESS_MODE] = 'default'; } */
             $_error = @ob_get_clean();
             if (strlen($_error) > 0) {
                 CAdminPanel::Log('PHP < WriteAction()' . AP_CRLF . $_error);
             }
             header('Location: ' . AP_INDEX_FILE . $_ref);
         } else {
             if ($this->_mode == 'pop') {
                 foreach ($this->_main as $_main) {
                     $_main->WritePop();
                 }
             } else {
                 $this->AddJsFile($this->AdminFolder() . '/js/common.js');
                 $this->AddCssFile($this->AdminFolder() . '/styles/styles.css');
                 $this->_mainRun();
                 $this->SetMainObStart();
                 @header('Content-type: text/html; charset=utf-8');
                 include CAdminPanel::RootPath() . '/templates/main.php';
             }
         }
     }
 }
Exemplo n.º 7
0
 /**
  * Returns a textual description of the error code (non-functional for SAXY Lite)
  * @param int The error code
  * @return string The error message
  */
 function xml_error_string($code)
 {
     CAdminPanel::Log('XML : ' . $code);
 }
Exemplo n.º 8
0
 /**
  * @return	bool
  */
 function Connect()
 {
     if ($this->_isConnect) {
         CAdminPanel::Log('DB : Repeating a connection (return true)');
         return true;
     }
     if (!defined('INCLUDEDBCLASS')) {
         include $this->PluginPath() . '/common/db/dbstorage.php';
         define('INCLUDEDBCLASS', 1);
     }
     $this->_db =& CommonDbStorageCreator::CreateDatabaseStorage($this->_wm_settings);
     CAdminPanel::Log('DB : Start Connect');
     if ($this->_db->Connect()) {
         $this->_isConnect = true;
     } else {
         CAdminPanel::Log('DB : Connect Error (' . $this->_db->_connector->ErrorDesc . ')');
     }
     return $this->_isConnect;
 }
Exemplo n.º 9
0
 /**
  * @param	string	$fileName
  * @return	bool
  */
 function SaveToFile($fileName)
 {
     $fstat = '';
     $fp = @fopen($fileName, 'wb');
     if ($fp) {
         $result = @fwrite($fp, $this->ToString(true)) !== false;
         $result &= @fclose($fp);
         return $result;
     } else {
         $fstat = @substr(sprintf('%o', fileperms($fileName)), -4);
         if (!$fstat) {
             $fstat = 'error';
         }
         CAdminPanel::Log('FILE > ' . $fileName . ' (' . $fstat . ') permission denied');
     }
     return false;
 }
Exemplo n.º 10
0
 function _setSqlError($errmess = '')
 {
     $this->ErrorCode = 0;
     $this->ErrorDesc = $errmess ? $errmess : @mssql_get_last_message();
     if (strlen($this->ErrorDesc) > 0) {
         CAdminPanel::Log('DB ERROR < ' . trim($this->ErrorDesc));
     }
 }