예제 #1
0
	<ul>
		<?php 
if (!isset($links)) {
    $links = array();
}
if (!isset($menu_holder)) {
    $menu_holder = isset($load_page) ? $load_page : 'main';
}
switch ($menu_holder) {
    case false:
    case 'main':
        // login is always there.
        if (!_UCM_INSTALLED) {
            //$links [] = array("name"=>"Setup","url"=>"index.php?p=setup","icon"=>"images/icon_home.gif");
        } else {
            if (!getcred()) {
                $links[] = array("name" => "Login", "url" => _BASE_HREF . "index.php?p=home", "icon" => "images/icon_home.gif");
            } else {
                if ($display_mode != 'mobile' && !defined('_CUSTOM_UCM_HOMEPAGE')) {
                    $home_link = array("name" => "Dashboard", "url" => _BASE_HREF . 'index.php?p=home', "icon" => "images/icon_home.gif", 'order' => 0);
                    if (!isset($_REQUEST['m']) || !$_REQUEST['m'] || $_REQUEST['m'][0] == 'index') {
                        $home_link['current'] = true;
                    }
                    $links[] = $home_link;
                }
            }
        }
        break;
}
if (!isset($menu_include_parent)) {
    $menu_include_parent = false;
예제 #2
0
 public static function auto_login($redirect = true)
 {
     if (strlen($_REQUEST['auto_login']) > 7) {
         $foo = explode(":", $_REQUEST['auto_login']);
         $user_id = (int) $foo[0];
         if ($user_id > 0) {
             // get the real key.
             $real_key = self::get_auto_login_string($user_id);
             if ($real_key == $_REQUEST['auto_login']) {
                 // log this security in !!
                 $sql = "SELECT * FROM " . _DB_PREFIX . "user WHERE user_id = '{$user_id}'";
                 $res = qa1($sql);
                 if ($res) {
                     if (getcred()) {
                         set_message(_l("You have been logged out."));
                     }
                     $_REQUEST['email'] = $res['email'];
                     $_REQUEST['password'] = $res['password'];
                     return self::process_login($redirect, false);
                 }
             }
         }
     }
     return false;
 }