Пример #1
0
function cronShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] !== E_ERROR) {
        return;
    }
    print_r(SysMessages::i()->getMessages());
}
Пример #2
0
 public static function init()
 {
     $_SESSION[self::$sessionVariable] = new Session();
     SysMessages::init();
     if (!isset($_SESSION["DBData"])) {
         self::reloadDBData();
     }
     Applications::init();
     JSLoader::init();
     if (!defined("PHYNX_VIA_INTERFACE")) {
         AppPlugins::init();
     }
 }
Пример #3
0
 function __construct($absolutePathToPhynx)
 {
     if (!defined("PHYNX_MAIN_STORAGE")) {
         if (function_exists("mysqli_connect")) {
             define("PHYNX_MAIN_STORAGE", "MySQL");
         } else {
             define("PHYNX_MAIN_STORAGE", "MySQLo");
         }
     }
     define("PHYNX_VIA_INTERFACE", true);
     if ($absolutePathToPhynx[strlen($absolutePathToPhynx) - 1] != "/") {
         $absolutePathToPhynx .= "/";
     }
     $this->absolutePath = $absolutePathToPhynx;
     $this->paths[] = $this->absolutePath . "libraries/PhpFileDB.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/Collection.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/Adapter.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/SelectStatement.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/DBStorage.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/DBStorageU.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/Attributes.class.php";
     #$this->paths[] = $this->absolutePath."classes/backend/PersistentClass.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/PersistentObject.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/User.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/anyC.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/Session.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/BackgroundPluginState.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/UnpersistentClass.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/PluginV2.class.php";
     $this->paths[] = $this->absolutePath . "classes/backend/XMLPlugin.class.php";
     $this->paths[] = $this->absolutePath . "classes/exceptions/o3AException.class.php";
     $this->paths[] = $this->absolutePath . "classes/exceptions/StorageException.class.php";
     $this->paths[] = $this->absolutePath . "classes/exceptions/NoDBUserDataException.class.php";
     $this->paths[] = $this->absolutePath . "classes/exceptions/AOPNoAdviceException.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/SysMessages.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/SystemCommand.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/PMReflector.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/Datum.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/Util.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/BPS.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/Factory.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/ISO3166.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/Aspect.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/EUCountries.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/Registry.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iFileBrowser.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iLDAPExport.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iDesktopLink.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/icontextMenu.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iCloneable.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iDeletable.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iDeletable2.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iRepeatable.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iScrollable.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iNewWithValues.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iGUIHTML2.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iGUIHTMLMP2.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iPluginSpecificRestrictions.class.php";
     #$this->paths[] = $this->absolutePath."classes/interfaces/iFPDF.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iXMLExport.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iUnifiedTable.class.php";
     $this->paths[] = $this->absolutePath . "classes/interfaces/iPluginV2.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/Users.class.php";
     #$this->paths[] = $this->absolutePath."classes/frontend/UserAttributes.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/AppPlugins.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/Applications.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/HTMLGUI.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/HTMLGUI2.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/HTML_de_DE.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/HTML_en_US.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/UnifiedTable.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/HTMLTable.class.php";
     $this->paths[] = $this->absolutePath . "classes/frontend/JSLoader.class.php";
     $this->paths[] = $this->absolutePath . "plugins/Userdata/mUserdata.class.php";
     $this->paths[] = $this->absolutePath . "plugins/Userdata/Userdata.class.php";
     #$this->paths[] = $this->absolutePath."plugins/Userdata/UserdataAttributes.class.php";
     $this->paths[] = $this->absolutePath . "classes/toolbox/LoginData.class.php";
     //Or else will not find Userdata
     $this->paths[] = $this->absolutePath . "classes/toolbox/Environment.class.php";
     $this->setPaths();
     if (!isset($_SESSION)) {
         session_start();
     }
     if (isset($_SESSION["S"]) and !is_object($_SESSION["S"]) and get_class($_SESSION["S"]) != "Session") {
         die($this->getErrorMessage("10"));
     }
     if (isset($_SESSION["messages"]) and !is_object($_SESSION["messages"]) and get_class($_SESSION["messages"]) != "SysMessages") {
         die($this->getErrorMessage("11"));
     }
     if (isset($_SESSION["BPS"]) and !is_object($_SESSION["BPS"]) and get_class($_SESSION["BPS"]) != "BackgroundPluginState") {
         die($this->getErrorMessage("12"));
     }
     if (!isset($_SESSION["S"])) {
         $_SESSION["S"] = new Session();
     }
     SysMessages::init();
     $_SESSION["messages"]->startLogging();
     $_SESSION["BPS"] = new BackgroundPluginState();
     $_SESSION["viaInterface"] = true;
 }
Пример #4
0
function log_error($errno, $errmsg, $filename, $linenum)
{
    if (!$GLOBALS["phynxLogPhpErrors"]) {
        return;
    }
    #if(strpos($filename, "PortscanGUI.class.php") !== false AND strpos($errmsg,"fsockopen") !== false) return;
    $errortype = array(E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice');
    if (defined('E_RECOVERABLE_ERROR')) {
        $errortype[E_RECOVERABLE_ERROR] = 'Catchable Fatal Error';
    }
    if (defined('E_DEPRECATED')) {
        $errortype[E_DEPRECATED] = 'Function Deprecated';
    }
    if (!isset($_SESSION["phynx_errors"])) {
        $_SESSION["phynx_errors"] = array();
    }
    if (!PHYNX_USE_SYSLOG) {
        $_SESSION["phynx_errors"][] = array($errortype[$errno], $errmsg, $filename, $linenum);
    } else {
        $type = LOG_INFO;
        switch ($errno) {
            case E_DEPRECATED:
            case E_STRICT:
                $type = LOG_DEBUG;
                break;
            case E_WARNING:
            case E_CORE_WARNING:
            case E_USER_WARNING:
            case E_COMPILE_WARNING:
                $type = LOG_WARNING;
                break;
            case E_PARSE:
            case E_ERROR:
            case E_CORE_ERROR:
            case E_USER_ERROR:
            case E_COMPILE_ERROR:
            case E_RECOVERABLE_ERROR:
                $type = LOG_ERR;
                break;
            case E_NOTICE:
            case E_USER_NOTICE:
                $type = LOG_NOTICE;
                break;
        }
        syslog($type, $errortype[$errno] . ": " . $errmsg . " in {$filename}:{$linenum}");
    }
    #$logfile = realpath(__DIR__."/../")."/log_".date("Y_m_d").".log";
    #@file_put_contents($logfile, date("Y d m H:i:s")." ".$errortype[$errno].": ".$errmsg." in $filename:$linenum\n", FILE_APPEND);
    #chmod($logfile, 0777);
    try {
        SysMessages::log($errortype[$errno] . ": " . $errmsg . "\n{$filename}:{$linenum}", "PHP");
    } catch (Exception $e) {
    }
}
Пример #5
0
function log_error($errno, $errmsg, $filename, $linenum)
{
    if (!$GLOBALS["phynxLogPhpErrors"]) {
        return;
    }
    #if(strpos($filename, "PortscanGUI.class.php") !== false AND strpos($errmsg,"fsockopen") !== false) return;
    $errortype = array(E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice');
    if (defined('E_RECOVERABLE_ERROR')) {
        $errortype[E_RECOVERABLE_ERROR] = 'Catchable Fatal Error';
    }
    if (defined('E_DEPRECATED')) {
        $errortype[E_DEPRECATED] = 'Function Deprecated';
    }
    if (!isset($_SESSION["phynx_errors"])) {
        $_SESSION["phynx_errors"] = array();
    }
    $_SESSION["phynx_errors"][] = array($errortype[$errno], $errmsg, $filename, $linenum);
    try {
        SysMessages::log($errortype[$errno] . ": " . $errmsg . "\n{$filename}:{$linenum}", "PHP");
    } catch (Exception $e) {
    }
}