<?php /* @type $Params string[] */ MMUserLogin::$isLogin = true; $module = $Params['Module']; $tpl = eZTemplate::factory(); $Result = array(); $siteINI = ezINI::instance( 'site.ini' ); $state = MMUserLogin::loginUser(); if ( $state ) { $destUrl = $siteINI->variable( 'SiteAccessSettings', 'JSPUrl' ); if( isset($_GET['context'])) { $context = trim($_GET['context']); if( preg_match( '#^(?:https?://|/)#', $context) ) { $destUrl = urldecode($_GET['context']); } } header('Location: '.$destUrl ); eZExecution::cleanExit(); } else {
/** * Reload Extenion ordering to reorder eZINI Global Override Dirs. * @TODO : Améliorer la gestion globale (éviter des appels multiples !!!) * @return void */ static public function reorderExtensions() { $siteINI = ezINI::instance(); if ( $siteINI->variable( 'ExtensionSettings', 'ExtensionOrdering' ) === 'enabled' ) { eZINI::removeGlobalOverrideDirsByScope( 'sa-extension' ); eZINI::removeGlobalOverrideDirsByScope( 'extension' ); self::activateExtensions( false ); } }
/** * Builds the mib tree, either for a single oid or for full settings. * Contrary to parents version, we store value too * NB: we do not cache this, as in pass_persist mode settings might change * over time (be added/removed, etc...) * @return array A nested array: * [ 1-n => [ 'name' => filename, 'children' => [ 1-n => [ 'name' => groupname, 'children' => [ 1-n => [ 'name' => settingname, 'value' => value, 'syntax' => asn-type, 'access' => rw/ro ] ] ] ] ] ] * @see eZMIBTree */ function getMIBTree($oid = null) { if ($oid != null) { $oid = explode('.', $oid); if (count($oid) != 3) { return 0; } } // nb: should try to avoid caching these settings, since the script can // be running for a long time $rootDir = 'settings'; $iniFiles = eZDir::recursiveFindRelative($rootDir, '', '.ini'); sort($iniFiles); $out = array(); foreach ($iniFiles as $key => $file) { $file = str_replace('/', '', $file); if ($oid == null || $key == $oid[0] - 1) { $ini = ezINI::instance($file); $outgroups = array(); $j = 1; $groups = $ini->groups(); ksort($groups); foreach ($groups as $group => $settings) { if ($oid == null || $j == $oid[1]) { $i = 1; $values = array(); ksort($settings); foreach ($settings as $setting => $val) { if ($oid == null || $i == $oid[2]) { if (is_numeric($val)) { $type = 'INTEGER'; } else { if ($val == 'true' || $val == 'enabled') { $type = 'Boolean'; $val = 1; } else { if ($val == 'false' || $val == 'disabled') { $type = 'Boolean'; $val = 2; } else { $type = 'DisplayString'; } } } $values[$i] = array('name' => $setting . ucfirst($group) . ucfirst(str_replace('.ini', '', $file)), 'value' => $val, 'syntax' => $type, 'access' => eZMIBTree::access_read_only, 'description' => $file . ' / ' . $group . ' / ' . $setting); } $i++; } $outgroups[$j] = array('name' => $group . ucfirst(str_replace('.ini', '', $file)), 'children' => $values); } $j++; } // we do not remove.ini here to avoid clashes with identifier 'shop', 'ldap', etc... $out[$key + 1] = array('name' => $file, 'children' => $outgroups); } } if ($oid == null) { $out = array('name' => 'eZPublish', 'children' => array(1 => array('name' => 'settings', 'children' => array(1 => array('name' => 'currentSASettings', 'children' => $out))))); } return $out; }
/** * @param string $hashedTicket * @return array */ public static function uncryptTicket ( $hashedTicket ) { eZDebug::writeNotice( $hashedTicket, 'uncryptTicket' ); $cryptedHash = base64_decode( $hashedTicket ); $mcopen = @mcrypt_module_open (MCRYPT_TripleDES, '', MCRYPT_MODE_ECB,''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($mcopen), MCRYPT_RAND); $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $mercINI = ezINI::instance( 'merck.ini' ); $key = $mercINI->variable( 'TicketLogin', 'DESKey' ); eZDebug::writeNotice( $key, 'DES KEY' ); $uncriptedHash = ''; if (mcrypt_generic_init($td, $key, $iv) != -1) { $uncriptedHash = mdecrypt_generic($td, $cryptedHash); mcrypt_generic_deinit($td); mcrypt_module_close($td); } $uncriptedHash = trim( $uncriptedHash, "\x00..\x1F" ); eZDebug::writeNotice($uncriptedHash, 'uncripted HASH' ); $uncryptedTicket = json_decode($uncriptedHash,true); eZDebug::writeNotice($uncryptedTicket, 'uncrypted TICKET' ); return $uncryptedTicket; }