Example #1
0
 /**
  * Decodes a token generated with encodeToken and returns an array of options
  * 
  * @param string $token token options
  * @param bool $url_decode should it URL decode the token true by default
  * @return array Array of options for the authentication token
  */
 function _decodeToken($token)
 {
     return (array) Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting('admin', 'token_key')));
 }
Example #2
0
 /**
  * This is the url_for version for helpers and emails.
  *
  * As we do not have the context of a host being requested, we need to know
  * the base_url like http://example.com in oder to add it to the generated URL
  */
 public function urlFor()
 {
     $args = func_get_args();
     $base_url = '';
     if (isset($args[0]['base_url'])) {
         $base_url = rtrim(preg_replace('/^(?!http[s]?:\\/\\/)(.+)/', 'http://$1', strstr($args[0]['base_url'], '.') ? $args[0]['base_url'] : Ak::getSetting('mailer', 'base_url', AK_HOST)), '/');
         unset($args[0]['base_url']);
     }
     unset($args[0]['only_path'], $args[0]['base_url']);
     return $base_url . call_user_func_array(array('Ak', 'toUrl'), $args);
 }
Example #3
0
 static function getTestTitle($options)
 {
     AkConfig::setOption('testing_url', AK_TESTING_URL);
     AkConfig::setOption('memcached_enabled', AkMemcache::isServerUp());
     AkUnitTestSuite::checkIfTestingWebserverIsAccesible($options);
     $dabase_settings = AK_DATABASE_SETTINGS_NAMESPACE == 'database' ? Ak::getSetting('database', 'type') : AK_DATABASE_SETTINGS_NAMESPACE;
     return "PHP " . phpversion() . ", Environment: " . AK_ENVIRONMENT . ", Database: " . $dabase_settings . (AkConfig::getOption('memcached_enabled', false) ? ', Memcached: enabled' : '') . (AkConfig::getOption('webserver_enabled', false) ? ', Testing URL: ' . AkConfig::getOption('testing_url') : ', Testing URL: DISABLED!!!') . "\n" . "Error reporting set to: " . AkConfig::getErrorReportingLevelDescription() . "\n" . trim($options['description']) . '';
 }
Example #4
0
 /**
  * Decodes a token generated with encodeToken and returns an array of options
  * 
  * @param string $token token options
  * @param bool $url_decode should it URL decode the token true by default
  * @return array Array of options for the authentication token
  */
 function _decodeToken($token)
 {
     return (array)Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting(AK_DEFAULT_ADMIN_SETTINGS, 'token_key')));
 }
Example #5
0
File: user.php Project: bermi/admin
 /**
  * Decodes a token generated with encodeToken and returns an array of options
  * 
  * @param string $token token options
  * @param bool $url_decode should it URL decode the token true by default
  * @return array Array of options for the authentication token
  */
 static function decodeToken($token)
 {
     return (array) Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting(self::getSettingsNamespace(), 'token_key')));
 }