Changeset 623 for trunk/mobile/index.php


Ignore:
Timestamp:
01/26/09 14:47:04 (15 years ago)
Author:
niltonneto
Message:

Resolve #399.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mobile/index.php

    r517 r623  
    44        $phpgw_info = array(); 
    55        $GLOBALS['sessionid'] = isset($_GET['sessionid']) ? $_GET['sessionid'] : @$_COOKIE['sessionid']; 
     6         
    67        if(!$GLOBALS['sessionid']) 
    7         { 
    8                 /*if (($GLOBALS['phpgw_info']['server']['use_https'] == 2) && ($_SERVER['HTTPS'] != 'on')) 
    9                 { 
    10  
    11                         Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
    12                         exit; 
    13                 } 
    14                 else 
    15                 {*/ 
    16                 $location = 'Location: ' . $_SERVER['SCRIPT_URL'].'login.php'; 
    17                 Header('Location: ' . $_SERVER['SCRIPT_URL'].'login.php'); 
    18                 //Header('Location: ' . $_SERVER['SCRIPT_URL'].'login.php' . 
    19                 //      (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? 
    20                 //      '?phpgw_forward='.urlencode('/index.php?'.$_SERVER['QUERY_STRING']):'')); 
     8        {                
     9                $location = 'Location: login.php'; 
     10                Header($location); 
    2111                exit; 
    22                 //      Header('Location: login.php'. 
    23                 //      (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? 
    24                 //      '?phpgw_forward='.urlencode('/mobile/index.php?'.$_SERVER['QUERY_STRING']):'')); 
    25                 //      exit; 
    26                 //} 
    2712        } 
    2813 
     
    3722                This is the menuaction driver for the multi-layered design 
    3823        */ 
     24 
    3925        if(isset($_GET['menuaction'])) 
    4026        { 
     
    4733        else 
    4834        { 
    49         //$phpgw->log->message('W-BadmenuactionVariable, menuaction missing or corrupt: %1',$menuaction); 
    50         //$phpgw->log->commit(); 
    5135                $mobileapp = 'home'; 
    5236                $invalid_data = True; 
    5337        } 
    5438 
     39         
    5540        $GLOBALS['phpgw_info']['flags'] = array( 
    5641                'noheader'   => True, 
     
    6247        include('../header.inc.php'); 
    6348        include('./mobile_header.inc.php'); 
    64  
     49         
    6550        if($mobileapp == 'home') 
    6651        { 
    67                 Header('Location: ' . $GLOBALS['phpgw']->link('/mobile/home.php')); 
     52                start_prefered_app(); 
    6853        } 
    69  
     54         
    7055        $GLOBALS[$class] = CreateObject(sprintf('%s.%s','mobile',$class)); 
    7156        $public_functions = $GLOBALS[$class]->public_functions; 
    7257        if((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data) 
    73         //if((is_array($public_functions) && $public_functions[$method]) && ! $invalid_data) 
    74         { 
    75                 execmethod($_GET['menuaction']); 
    76                 print_header(); 
    77                 print_footer(); 
     58        {                                                
     59                $GLOBALS['phpgw_info']['mobiletemplate'] = CreateObject("mobile.mobiletemplate");                                        
     60                $GLOBALS['phpgw_info']['mobiletemplate'] -> print_page($class,$method);          
    7861                unset($mobileapp); 
    7962                unset($class); 
    8063                unset($method); 
    8164                unset($invalid_data); 
     65 
    8266        } 
    8367        else 
     
    11195                { 
    11296                        $GLOBALS['phpgw']->log->commit(); 
    113                 } 
    114                 $GLOBALS['phpgw']->redirect_link('/mobile/home.php'); 
     97                }                
     98                start_prefered_app(); 
    11599        } 
    116100 
Note: See TracChangeset for help on using the changeset viewer.