⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.50
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-horde
/
ingo
/
lib
/
View File Name :
Application.php
true ); /** */ public $version = 'H5 (3.2.16)'; /** * Cached list of all rulesets. * * @var array */ protected $_rulesets; /** */ protected function _bootstrap() { global $injector; $injector->bindFactory('Ingo_Shares', 'Ingo_Factory_Shares', 'create'); } /** */ protected function _init() { global $registry, $session; // Create the session. if (!$session->exists('ingo', 'script_categories')) { Ingo_Session::create(); } if ($sig = $session->get('ingo', 'personal_share')) { $curr_share = $session->get('ingo', 'current_share'); $ruleset = Horde_Util::getFormData('ruleset'); /* Select current share. */ if (is_null($curr_share) || (!empty($ruleset) && $ruleset != $curr_share)) { $session->set('ingo', 'current_share', $ruleset); $all_rulesets = $this->_listRulesets(); if (is_null($curr_share) || empty($all_rulesets[$ruleset]) || !$all_rulesets[$ruleset]->hasPermission($registry->getAuth(), Horde_Perms::READ)) { $session->set('ingo', 'current_share', $sig); } } } } /** */ public function getInitialPage() { return strval(Ingo::getInitialPage()->setRaw(true)); } /** */ public function menu($menu) { global $conf, $injector, $prefs, $registry, $session; $s_categories = $session->get('ingo', 'script_categories'); $vars = $injector->getInstance('Horde_Variables'); $menu->add(Ingo_Basic_Filters::url(), _("Filter _Rules"), 'ingo-rules', null, null, null, $vars->page == 'filters' ? 'current' : '__noselection'); try { if (in_array(Ingo_Storage::ACTION_WHITELIST, $s_categories)) { $menu->add(Horde::url($registry->link('mail/showWhitelist')), _("_Whitelist"), 'ingo-whitelist', null, null, null, $vars->page == 'whitelist' ? 'current' : '__noselection'); } if (in_array(Ingo_Storage::ACTION_BLACKLIST, $s_categories)) { $menu->add(Horde::url($registry->link('mail/showBlacklist')), _("_Blacklist"), 'ingo-blacklist', null, null, null, $vars->page == 'blacklist' ? 'current' : '__noselection'); } } catch (Horde_Exception $e) { Horde::log($e, 'ERR'); } if (in_array(Ingo_Storage::ACTION_VACATION, $s_categories)) { $menu->add(Ingo_Basic_Vacation::url(), _("_Vacation"), 'ingo-vacation', null, null, null, $vars->page == 'vacation' ? 'current' : '__noselection'); } if (in_array(Ingo_Storage::ACTION_FORWARD, $s_categories)) { $menu->add(Ingo_Basic_Forward::url(), _("_Forward"), 'ingo-forward', null, null, null, $vars->page == 'forward' ? 'current' : '__noselection'); } if (in_array(Ingo_Storage::ACTION_SPAM, $s_categories)) { $menu->add(Ingo_Basic_Spam::url(), _("S_pam"), 'ingo-spam', null, null, null, $vars->page == 'spam' ? 'current' : '__noselection'); } if ((!$prefs->isLocked('auto_update') || !$prefs->getValue('auto_update')) && $injector->getInstance('Ingo_Factory_Script')->hasFeature('script_file')) { $menu->add(Ingo_Basic_Script::url(), _("_Script"), 'ingo-script', null, null, null, $vars->page == 'script' ? 'current' : '__noselection'); } if (($shares = $injector->getInstance('Ingo_Shares')) && empty($conf['share']['no_sharing'])) { if ($shares->getShare($session->get('ingo', 'current_share'))->get('owner') == $registry->getAuth()) { $share = $session->get('ingo', 'current_share'); } else { $share = $session->get('ingo', 'backend/id') . ':' . $registry->getAuth(); } $menu->add( '#', _("_Permissions"), 'horde-perms', null, '', Horde::popupJs( Horde::url( $registry->get('webroot', 'horde') . '/services/shares/edit.php', true ), array( 'params' => array( 'app' => 'ingo', 'share' => $share ), 'urlencode' => true ) ) . 'return false;' ); } } /** * Add additional items to the sidebar. * * @param Horde_View_Sidebar $sidebar The sidebar object. */ public function sidebar($sidebar) { global $injector, $session; $actions = array(); foreach ($injector->getInstance('Ingo_Factory_Script')->createAll() as $script) { $actions = array_merge($actions, $script->availableActions()); } $filters = $injector->getInstance('Ingo_Factory_Storage') ->create() ->retrieve(Ingo_Storage::ACTION_FILTERS) ->getFilterList(); if (!empty($actions)) { $max = $injector->getInstance('Horde_Core_Perms')->hasAppPermission(Ingo_Perms::getPerm('max_rules')); if (($max === true) || ($max > count($filters))) { $sidebar->addNewButton(_("New Rule"), Ingo_Basic_Rule::url()); } } if ($injector->getInstance('Ingo_Shares') && (count($all_rulesets = $this->_listRulesets()) > 1)) { $url = Ingo_Basic_Filters::url(); $current = $session->get('ingo', 'current_share'); $sidebar->containers['rulesets'] = array( 'header' => array( 'id' => 'ingo-toggle-rules', 'label' => _("Ruleset"), 'collapsed' => false, ), ); foreach ($all_rulesets as $id => $ruleset) { $row = array( 'selected' => ($current == $id), 'url' => $url->add('ruleset', $id), 'label' => $ruleset->get('name'), 'type' => 'radiobox', ); $sidebar->addRow($row, 'rulesets'); } } } /** */ public function perms() { return $GLOBALS['injector']->getInstance('Ingo_Perms')->perms(); } /** */ public function hasPermission($permission, $allowed, $opts = array()) { return $GLOBALS['injector']->getInstance('Ingo_Perms')->hasPermission($permission, $allowed, $opts); } /** */ public function removeUserData($user) { global $injector; /* Remove all filters/rules owned by the user. */ try { $injector->getInstance('Ingo_Factory_Storage')->create()->removeUserData($user); } catch (Ingo_Exception $e) { Horde::log($e, 'ERR'); throw $e; } /* Now remove all shares owned by the user. */ if ($ingo_shares = $injector->getInstance('Ingo_Shares')) { /* Get the user's default share. */ try { $ingo_shares->removeShare($ingo_shares->getShare($user)); } catch (Horde_Share_Exception $e) { Horde::log($e, 'ERR'); throw new Ingo_Exception($e); } /* Get a list of all shares this user has perms to and remove the * perms. */ try { $shares = $ingo_shares->listShares($user); foreach ($shares as $share) { $share->removeUser($user); } } catch (Horde_Share_Exception $e) { Horde::log($e, 'ERR'); } /* Get a list of all shares this user owns and has perms to delete * and remove them. */ try { $shares = $ingo_shares->listShares($user, array( 'attributes' => $user, 'perm' => Horde_Perms::DELETE )); } catch (Horde_Share_Exception $e) { Horde::log($e, 'ERR'); throw new Ingo_Exception($e); } foreach ($shares as $share) { $ingo_shares->removeShare($share); } } } /** * Returns all rulesets a user has access to. * * @return array The ruleset list. */ protected function _listRulesets() { global $injector, $registry; if (isset($this->_rulesets)) { return $this->_rulesets; } $this->_rulesets = array(); try { if (!($share = $injector->getInstance('Ingo_Shares'))) { return $this->_rulesets; } $tmp = $share->listShares( $registry->getAuth(), array('perm' => Horde_Perms::SHOW) ); } catch (Horde_Share_Exception $e) { Horde::log($e, 'ERR'); return $this->_rulesets; } /* Check if filter backend of the share still exists. */ $backends = Ingo::loadBackends(); foreach ($tmp as $id => $ruleset) { list($backend) = explode(':', $id); if (isset($backends[$backend])) { $this->_rulesets[$id] = $ruleset; } } return $this->_rulesets; } }