Beispiel #1
0
 /**
  * Setting the links for motd, mail etc.
  *
  * @param array $a_links        the array of all needed links
  */
 public static function set_links($a_links = array())
 {
     if ($a_links === array()) {
         $a_links = Config::get_default_html('section_more');
     }
     foreach ($a_links as $key => $value) {
         $key_value = __($key);
         if (is_null($value)) {
             $key_value = null;
         }
         //todo do translation later
         Template::get_instance()->set_output($key, $key_value);
         if (is_null($key_value)) {
             Template::get_instance()->set_output($key . '-link', $value);
         } else {
             Template::get_instance()->set_output($key . '-link', $value . '?' . LOGD_Core::create_random_uri_string());
         }
     }
 }
Beispiel #2
0
 /**
  * Create a random string for append at the uri
  *
  * @return string   the unique/random string
  */
 public static function create_random_uri_string()
 {
     //check if the static-member is an empty one, if yes - calculate it
     if (is_null(self::$s_random_string)) {
         //if we had a unique-id of the server, calculate if this value an random-string
         //else calculate if the PHP-OS Constant an random string
         if (is_null($_SERVER['UNIQUE_ID']) || $_SERVER['UNIQUE_ID'] === '') {
             $s_random = str_shuffle(PHP_OS . time());
             $s_random_string = str_shuffle(base64_encode($s_random));
         } else {
             $s_random = str_shuffle($_SERVER['UNIQUE_ID'] . time());
             $s_random_string = str_shuffle(base64_encode($s_random));
         }
         self::$s_random_string = $s_random_string;
     }
     return self::$s_random_string;
 }