Changeset 431 for trunk/mobile
- Timestamp:
- 09/16/08 15:20:30 (16 years ago)
- Location:
- trunk/mobile
- Files:
-
- 10 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mobile/calendar.php
r286 r431 7 7 } 8 8 9 // Flag currentapp modificada para mobile 10 // Inserida flag mobileapp e definida como calendar 9 11 $GLOBALS['phpgw_info']['flags'] = array( 10 12 'noheader' => True, 11 13 'nonavbar' => True, 12 'currentapp' => 'calendar', 14 'currentapp' => 'mobile', 15 'mobileapp' => 'calendar', 13 16 'enable_network_class' => True, 14 17 'enable_contacts_class' => True, 15 18 'enable_nextmatchs_class' => True 16 ); 19 ); 17 20 include('../header.inc.php'); 21 include('mobile_header.inc.php'); 22 23 // Utiliza o novo header para a página principal. 24 print_header(); 25 18 26 $accountId = $GLOBALS['phpgw_info']['user']['account_id']; 19 ?> 20 <html> 21 <head> 22 <meta http-equiv="Content-Language" content="en" /> 23 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 24 <LINK href="../phpgwapi/templates/<?=$GLOBALS['phpgw_info']['server']['template_set']?>/css/<?=$GLOBALS['phpgw_info']['server']['template_set']?>.css" type=text/css rel=StyleSheet> 25 <title>Minha Agenda Semanal</title> 26 </head> 27 <body style="background-color:white !important"> 28 <?echo lang("User").": ".$GLOBALS['phpgw_info']['user']['firstname']?> <?=$GLOBALS['phpgw_info']['user']['lastname'];?> [<?=$GLOBALS['phpgw_info']['user']['account_lid']?>]<br> 29 Expresso Livre :: Agenda :: <a href="./login.php?cd=1"><?=lang("Logout")?></a> 30 <? 27 31 28 $uicalendar = CreateObject("calendar.uicalendar"); 32 29 $daysofWeek = array(lang('Sunday'), lang('Monday'),lang('Tuesday'),lang('Wednesday'),lang('Thursday'),lang('Friday'),lang('Saturday')); … … 52 49 $daily = $uicalendar->bo->cached_events; 53 50 $p = CreateObject('phpgwapi.Template', "../mobile/templates/".$GLOBALS['phpgw_info']['server']['template_set']); 54 $p->set_file(Array('view' => 'calendar.tpl')); 51 $p->set_file(Array('view' => 'calendar.tpl')); 55 52 $data[] = array(); 56 53 @ksort($daily); 57 54 58 55 if($daily){ 59 $p->set_block('view','view_event'); 56 $p->set_block('view','view_event'); 60 57 foreach($daily as $date => $day_params) { 61 58 $year = (int)substr($date,0,4); … … 64 61 $day_of_week = $daysofWeek[$GLOBALS['phpgw']->datetime->day_of_week($year,$month,$day)]; 65 62 $p->set_var("header_date",$day_of_week." - ".$day."/".$month."/".$year); 66 for($i = 0; $i < count($day_params);$i++) { 63 for($i = 0; $i < count($day_params);$i++) { 67 64 $vars = $uicalendar->bo->event2array($day_params[$i]); 68 65 $data = array ( … … 78 75 "description_data" => $vars['description']['data'] ? $vars['description']['data'] : " " 79 76 ); 80 77 81 78 $p->set_var($data); 82 79 $p->parse('views','view_event',True); 83 } 80 } 84 81 } 85 82 $p->pfp('out','views'); 86 83 } 87 84 else { 88 $p->set_block('view','no_event'); 85 $p->set_block('view','no_event'); 89 86 $syear = date('Y',$tstart); 90 87 $smonth = date('m',$tstart); … … 95 92 $p->set_var("start_date",$sday."/".$smonth."/".$syear); 96 93 $p->set_var("end_date", $eday."/".$emonth."/".$eyear); 97 $p->pfp('out','no_event'); 98 } 94 $p->pfp('out','no_event'); 95 } 96 97 // Utiliza o novo footer. 98 print_footer(); 99 99 ?> 100 </body>101 </html> -
trunk/mobile/index.php
r273 r431 1 1 <?php 2 //TODO: Aplicar o conceito de subapp (mobileapp) 3 2 4 $phpgw_info = array(); 5 $GLOBALS['sessionid'] = isset($_GET['sessionid']) ? $_GET['sessionid'] : @$_COOKIE['sessionid']; 6 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']):'')); 21 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 //} 27 } 28 29 if ($GLOBALS['phpgw_info']['server']['use_https'] > 0) { 30 if ($_SERVER['HTTPS'] != 'on') { 31 Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 32 exit; 33 } 34 } 35 36 /* 37 This is the menuaction driver for the multi-layered design 38 */ 39 if(isset($_GET['menuaction'])) 40 { 41 list($mobileapp,$class,$method) = explode('.',@$_GET['menuaction']); 42 if(! $mobileapp || ! $class || ! $method) 43 { 44 $invalid_data = True; 45 } 46 } 47 else 48 { 49 //$phpgw->log->message('W-BadmenuactionVariable, menuaction missing or corrupt: %1',$menuaction); 50 //$phpgw->log->commit(); 51 $mobileapp = 'home'; 52 $invalid_data = True; 53 } 54 3 55 $GLOBALS['phpgw_info']['flags'] = array( 4 ' disable_Template_class'=> True,5 ' login'=> True,6 'currentapp' => 'login',7 ' noheader' => True56 'noheader' => True, 57 'nonavbar' => True, 58 'currentapp' => 'mobile', 59 'mobileapp' => $mobileapp, 8 60 ); 9 61 10 include('../header.inc.php'); 11 Header('Location: https://' . $_SERVER['HTTP_HOST'] .$_SERVER['SCRIPT_URL'].'login.php'); 62 include('../header.inc.php'); 63 include('./mobile_header.inc.php'); 64 65 if($mobileapp == 'home') 66 { 67 Header('Location: ' . $GLOBALS['phpgw']->link('/mobile/home.php')); 68 } 69 70 $GLOBALS[$class] = CreateObject(sprintf('%s.%s','mobile',$class)); 71 $public_functions = $GLOBALS[$class]->public_functions; 72 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 print_header(); 76 execmethod($_GET['menuaction']); 77 print_footer(); 78 unset($mobileapp); 79 unset($class); 80 unset($method); 81 unset($invalid_data); 82 } 83 else 84 { 85 if(!$mobileapp || !$class || !$method) 86 { 87 if(@is_object($GLOBALS['phpgw']->log)) 88 { 89 $GLOBALS['phpgw']->log->message(array( 90 'text' => 'W-BadmenuactionVariable, menuaction missing or corrupt: %1', 91 'p1' => $menuaction, 92 'line' => __LINE__, 93 'file' => __FILE__ 94 )); 95 } 96 } 97 98 if(!is_array($GLOBALS[$class]->public_functions) || ! $GLOBALS[$class]->public_functions[$method] && $method) 99 { 100 if(@is_object($GLOBALS['phpgw']->log)) 101 { 102 $GLOBALS['phpgw']->log->message(array( 103 'text' => 'W-BadmenuactionVariable, attempted to access private method: %1', 104 'p1' => $method, 105 'line' => __LINE__, 106 'file' => __FILE__ 107 )); 108 } 109 } 110 if(@is_object($GLOBALS['phpgw']->log)) 111 { 112 $GLOBALS['phpgw']->log->commit(); 113 } 114 $GLOBALS['phpgw']->redirect_link('/mobile/home.php'); 115 } 116 12 117 ?> -
trunk/mobile/login.php
r273 r431 1 1 <?php 2 //TODO: Trocar name="login" para name="user" no campo username 2 3 $phpgw_info = array(); 3 4 $submit = False; … … 14 15 $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid']; 15 16 if(isset($GLOBALS['sessionid']) && $_GET['cd'] != 10 && $_GET['cd'] != 1) 16 $GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw_info']['flags']['currentdir'].'/calendar.php'); 17 //$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw_info']['flags']['currentdir'].'/calendar.php'); 18 //session_start(); 19 $GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw_info']['flags']['currentdir'].'/home.php'); 17 20 if ($GLOBALS['phpgw_info']['server']['use_https'] > 0) { 18 21 if ($_SERVER['HTTPS'] != 'on') { … … 23 26 24 27 $GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions'); 25 $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT.$GLOBALS['phpgw_info']['flags']['currentdir'].'/templates/'.$GLOBALS['phpgw_info']['login_template_set']; 28 //$GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT.$GLOBALS['phpgw_info']['flags']['currentdir'].'/templates/'.$GLOBALS['phpgw_info']['login_template_set']; 29 $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT.$GLOBALS['phpgw_info']['flags']['currentdir'].'/templates/'; 26 30 $tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']); 27 31 $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['login_template_set']; 28 32 $tmpl->set_file(array('login_form' => 'login.tpl')); 29 33 $tmpl->set_var('cd',check_logoutcode($_GET['cd'])); 30 34 31 35 function check_logoutcode($code) { 32 36 switch($code) { 33 37 case 1: 34 logout(); 38 logout(); 35 39 return lang('You have been successfully logged out'); 36 40 37 41 case 2: 38 42 return lang('Sorry, your login has expired'); 39 43 40 44 case 4: 41 45 return lang('Cookies are required to login to this site.'); 42 46 43 47 case 5: 44 48 return '<font color="FF0000">' . lang('Bad login or password') . '</font>'; … … 46 50 case 6: 47 51 return '<font color="FF0000">' . lang('Your password has expired, and you do not have access to change it') . '</font>'; 48 52 49 53 case 98: 50 54 return '<font color="FF0000">' . lang('Account is expired') . '</font>'; 51 55 52 56 case 99: 53 57 return '<font color="FF0000">' . lang('Blocked, too many attempts') . '</font>'; 54 58 55 59 case 10: 56 60 $GLOBALS['phpgw']->session->phpgw_setcookie('sessionid'); … … 61 65 } 62 66 return '<font color="#FF0000">' . lang('Your session could not be verified.') . '</font>'; 63 67 64 68 default: 65 69 return ' '; 66 70 } 67 } 71 } 68 72 69 73 if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) { … … 83 87 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link($GLOBALS['phpgw_info']['flags']['currentdir'].'/login.php','cd=5')); 84 88 } 85 89 86 90 if(!$submit) 87 91 $login = $_POST['login']; 88 92 89 93 $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u'); 90 94 … … 93 97 } 94 98 else{ 95 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] .$GLOBALS['phpgw_info']['flags']['currentdir'].'/calendar.php'); 99 //$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] .$GLOBALS['phpgw_info']['flags']['currentdir'].'/calendar.php'); 100 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] .$GLOBALS['phpgw_info']['flags']['currentdir'].'/home.php'); 96 101 } 97 102 } … … 103 108 $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang; 104 109 } 105 106 $tmpl->set_var('charset',$GLOBALS['phpgw']->translation->charset()); 110 111 $tmpl->set_var('charset',$GLOBALS['phpgw']->translation->charset()); 107 112 $tmpl->set_var('cookie',$last_loginid); 108 113 $tmpl->set_var('lang_username',lang('username')); … … 113 118 $tmpl->set_var('language_select',''); 114 119 $tmpl->set_var($var); 115 $tmpl->set_block('login_form','language_select'); 120 $tmpl->set_block('login_form','language_select'); 116 121 $tmpl->pfp('loginout','login_form'); 117 122 … … 135 140 $GLOBALS['phpgw']->session->destroy($GLOBALS['sessionid'],$GLOBALS['kp3']); 136 141 } 137 } 142 } 138 143 ?>
Note: See TracChangeset
for help on using the changeset viewer.