public static function login($anonymous = null) { $now = time(); if (self::$_logged_in && self::$_login_expire > $now) { return self::$_logged_in; } $result = ZTVDaemonController::login(!is_null($anonymous) ? array('-A' => $anonymous) : array()); if ($result->output === false) { hd_print('Error: can\'t execute arescam.'); throw new DuneException('Internal ARES error', 0, ActionFactory::show_error(true, '%tr%caption_system_error', array('%tr%error_daemon_execution_failed', '%tr%error_contact_support'))); } self::$_logged_in = $result->rc === 0; if (self::$_logged_in) { self::$_login_expire = $now + 86400; } return self::$_logged_in; }