Changeset 979
- Timestamp:
- 02/28/06 09:21:36 (7 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 1 added
- 12 removed
- 12 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/admin/hotspot_location_map.php (modified) (3 diffs)
-
wifidog/classes/Content.php (modified) (2 diffs)
-
wifidog/classes/MainUI.php (modified) (1 diff)
-
wifidog/classes/SmartyWifidog.php (modified) (1 diff)
-
wifidog/classes/Style.php (modified) (1 diff)
-
wifidog/config.php (modified) (1 diff)
-
wifidog/content/index.php (modified) (1 diff)
-
wifidog/gw_message.php (modified) (1 diff)
-
wifidog/local_content/README (deleted)
-
wifidog/local_content/default/footer.html (deleted)
-
wifidog/local_content/default/header.html (deleted)
-
wifidog/local_content/default/new.css (deleted)
-
wifidog/local_content/default/portal.html (deleted)
-
wifidog/login/index.php (modified) (1 diff)
-
wifidog/portal/index.php (modified) (7 diffs)
-
wifidog/portal/missing_original_url.php (deleted)
-
wifidog/templates/generic_error.html (modified) (1 diff)
-
wifidog/templates/message_activate.html (deleted)
-
wifidog/templates/message_default.html (deleted)
-
wifidog/templates/message_denied.html (deleted)
-
wifidog/templates/message_failed_validation.html (deleted)
-
wifidog/templates/message_unknown_hotspot.html (deleted)
-
wifidog/templates/sites/portal.tpl (added)
-
wifidog/templates/user_management_menu.html (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r978 r979 1 2006-02-28 Max Horváth <max.horvath@maxspot.de> 2 * the content selector for an owner could produce notices 3 * the button add existing content in the content manager will only be shown 4 if content is actually available 5 * the start button on the portal page won't be shown anymore if a user 6 didn't access it from a WiFiDog hotspot 7 * deleted wifidog/templates/message_unknown_hotspot.html as this error 8 message will be displayed using the genecir error message template 9 * display of generic error messages will be handled by the MainUI class 10 * deleted wifidog/portal/missing_original_url.php as its functions is being 11 handled by wifidog/portal/index.php now 12 * deleted wifidog/templates/message_default.html as its functions is being 13 handled by wifidog/gw_message.php now 14 * deleted wifidog/templates/message_activate.html as its functions is being 15 handled by wifidog/gw_message.php now 16 * account validation hints finally show the real validation grace time 17 (used to display 15 minutes) 18 * deleted wifidog/templates/message_denied.html as its functions is being 19 handled by wifidog/gw_message.php now 20 * deleted wifidog/templates/message_failed_validation.html as its functions 21 is being handled by wifidog/gw_message.php now 22 * deleted wifidog/templates/user_management_menu.html as its not being 23 used anymore 24 * deleted wifidog/local_content/default/footer.html as its not being 25 used anymore 26 * deleted wifidog/local_content/default/header.html as its not being 27 used anymore 28 * deleted wifidog/local_content/default/portal.html as its not being 29 used anymore 30 * deleted wifidog/local_content/default/new.css as its wasn't ever used 31 * deleted wifidog/local_content/README as its content isn't valid anymore 32 used anymore 33 1 34 2006-02-26 Max Horváth <max.horvath@maxspot.de> 2 35 * Hotspots map page now uses a direct Javascript call for the link -
trunk/wifidog-auth/wifidog/admin/hotspot_location_map.php
r974 r979 51 51 52 52 require_once('classes/Node.php'); 53 require_once('classes/Network.php'); 53 54 require_once('classes/AbstractGeocoder.php'); 54 55 require_once('classes/MainUI.php'); 56 require_once('classes/Server.php'); 55 57 56 58 $ui = new MainUI(); … … 62 64 63 65 // Add Google Maps JavaScript ( must set config values ) 64 $html_headers = "<script src=\"http://maps.google.com/maps?file=api&v=1&key=" .GMAPS_PUBLIC_API_KEY."\" type=\"text/javascript\"></script>";66 $html_headers = "<script src=\"http://maps.google.com/maps?file=api&v=1&key=" . Server::getCurrentServer()->getGoogleAPIKey() . "\" type=\"text/javascript\"></script>"; 65 67 $ui->setHtmlHeader($html_headers); 66 68 … … 87 89 $script .= "map.addControl(new GLargeMapControl());\n"; 88 90 $script .= "map.addControl(new GMapTypeControl());\n"; 91 $script .= "map.setMapType(" . $node->getNetwork()->getGisMapType() . ");\n"; 89 92 $script .= "map.centerAndZoom(new GPoint($long, $lat), 1);\n"; 90 93 $script .= "var current_marker_point = new GPoint($long, $lat);\n"; -
trunk/wifidog-auth/wifidog/classes/Content.php
r974 r979 556 556 $html .= "<li class='admin_section_list_item'>\n"; 557 557 $name = "{$user_prefix}_new_existing"; 558 $html .= Content :: getSelectContentUI($name, "AND content_id NOT IN (SELECT content_id FROM $link_table WHERE $link_table_obj_key_col='$link_table_obj_key')"); 558 $_contentSelector = Content::getSelectContentUI($name, "AND content_id NOT IN (SELECT content_id FROM $link_table WHERE $link_table_obj_key_col='$link_table_obj_key')"); 559 $html .= $_contentSelector; 559 560 $name = "{$user_prefix}_new_display_location"; 560 561 561 562 $html .= "<input type='hidden' name='{$name}' value='{$display_location}'>\n"; 562 563 $name = "{$user_prefix}_new_existing_submit"; 563 $html .= "<input type='submit' name='$name' value='"._("Add")."'>"; 564 565 if (strpos($_contentSelector, _("Sorry, no content available in the database")) === false) { 566 $html .= "<input type='submit' name='$name' value='"._("Add")."'>"; 567 } 568 564 569 $html .= "</li>\n"; 565 570 $html .= "<li class='admin_section_list_item'>\n"; … … 721 726 722 727 if ($type_interface != "table") { 723 $_html .= FormSelectGenerator::generateFromArray($_tab, null, $_name, null, false); 728 if (isset($_tab)) { 729 $_html .= FormSelectGenerator::generateFromArray($_tab, null, $_name, null, false); 730 } else { 731 $_html .= "<div class='warningmsg'>" . _("Sorry, no content available in the database") . "</div>\n"; 732 } 724 733 } else { 725 734 $_html .= "</table>\n"; -
trunk/wifidog-auth/wifidog/classes/MainUI.php
r938 r979 538 538 } 539 539 540 function displayError($errmsg) 540 /** 541 * Display a generic error message 542 * 543 * @param string $errmsg The error message to be displayed 544 * @param bool $show_tech_support_email Defines wether to show the link of 545 * the tech-support 546 * 547 * @return void 548 * 549 * @access public 550 */ 551 function displayError($errmsg, $show_tech_support_email = true) 541 552 { 542 553 // Init ALL smarty values 543 554 $this->smarty->assign("error", ""); 555 $this->smarty->assign("show_tech_support_email", false); 544 556 $this->smarty->assign("tech_support_email", ""); 545 557 546 558 // Define needed error content 547 559 $this->smarty->assign("error", $errmsg); 548 $this->smarty->assign("tech_support_email", Network::getCurrentNetwork()->getTechSupportEmail()); 560 561 if ($show_tech_support_email) { 562 $this->smarty->assign("show_tech_support_email", true); 563 $this->smarty->assign("tech_support_email", Network::getCurrentNetwork()->getTechSupportEmail()); 564 } 549 565 550 566 /* 551 567 * Output the error message 552 568 */ 553 $_html = $this->smarty->fetch("templates/ generic_error.html");569 $_html = $this->smarty->fetch("templates/sites/error.tpl"); 554 570 555 571 $this->setMainContent($_html); -
trunk/wifidog-auth/wifidog/classes/SmartyWifidog.php
r938 r979 94 94 $this->assign('request_uri', $_SERVER["REQUEST_URI"]); 95 95 96 if(is_file(NODE_CONTENT_PHP_RELATIVE_PATH.PAGE_HEADER_NAME)) 97 { 98 $this->assign('header_file',NODE_CONTENT_SMARTY_PATH.PAGE_HEADER_NAME); 99 } 100 else 101 { 102 $this->assign('header_file',DEFAULT_CONTENT_SMARTY_PATH.PAGE_HEADER_NAME); 103 } 104 105 if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.PORTAL_PAGE_NAME)) { 106 $this->assign('portal_page', NODE_CONTENT_SMARTY_PATH.PORTAL_PAGE_NAME); 107 } else { 108 $this->assign('portal_page', DEFAULT_CONTENT_SMARTY_PATH.PORTAL_PAGE_NAME); 109 } 110 111 if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.PORTAL_PAGE_NAME)) { 96 if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.LOGIN_PAGE_NAME)) { 112 97 $this->assign('login_page', NODE_CONTENT_SMARTY_PATH.LOGIN_PAGE_NAME); 113 98 } else { 114 99 $this->assign('login_page', DEFAULT_CONTENT_SMARTY_PATH.LOGIN_PAGE_NAME); 115 100 } 116 117 if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.PAGE_FOOTER_NAME))118 {119 $this->assign('footer_file',NODE_CONTENT_SMARTY_PATH.PAGE_FOOTER_NAME);120 }121 else122 {123 $this->assign('footer_file',DEFAULT_CONTENT_SMARTY_PATH.PAGE_FOOTER_NAME);124 }125 101 126 102 if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.STYLESHEET_NAME)) -
trunk/wifidog-auth/wifidog/classes/Style.php
r915 r979 89 89 $smarty = new SmartyWifidog; 90 90 $smarty->assign('title',$title); 91 $retval = $smarty->fetch(DEFAULT_CONTENT_SMARTY_PATH.PAGE_HEADER_NAME);91 //$retval = $smarty->fetch(DEFAULT_CONTENT_SMARTY_PATH.PAGE_HEADER_NAME); 92 92 global $starttime; 93 93 $starttime = microtime(); -
trunk/wifidog-auth/wifidog/config.php
r974 r979 321 321 define('DEFAULT_NODE_ID', 'default'); 322 322 323 /********************************************************************\324 * DEPRECATED VALUES *325 \********************************************************************/326 327 /**328 * @deprecated since 2005-04-19329 */330 define('PAGE_HEADER_NODE', 'header.html');331 332 /**333 * @deprecated since 2005-04-19334 */335 define('PAGE_HEADER_NAME', 'header.html');336 337 /**338 * @deprecated since 2005-04-19339 */340 define('PAGE_FOOTER_NODE', 'footer.html');341 342 /**343 * @deprecated since 2005-04-19344 */345 define('PAGE_FOOTER_NAME', 'footer.html');346 347 /**348 * @deprecated since 2005-04-19349 */350 define('PORTAL_PAGE_NAME', 'portal.html');351 352 323 /** 353 324 * In case this is the local.config.php you should remove the next lines. -
trunk/wifidog-auth/wifidog/content/index.php
r933 r979 62 62 $node = Node :: getObject($_REQUEST['gw_id']); 63 63 64 if ($node == null) 65 { 66 $smarty->assign("tech_support_email", Network::getCurrentNetwork()->getTechSupportEmail()); 67 $smarty->display("templates/message_unknown_hotspot.html"); 64 if ($node == null) { 65 $ui = new MainUI(); 66 $ui->displayError(_("No Hotspot specified!")); 68 67 exit; 69 68 } -
trunk/wifidog-auth/wifidog/gw_message.php
r916 r979 50 50 51 51 require_once('include/common_interface.php'); 52 require_once('classes/User.php'); 53 require_once('classes/Network.php'); 54 require_once('classes/MainUI.php'); 55 56 $ui = new MainUI(); 57 $errmsg = ""; 52 58 53 59 if (isset($_REQUEST["message"])) { 54 60 switch ($_REQUEST["message"]) { 55 case "failed_validation": 56 $smarty->display("templates/message_failed_validation.html"); 57 break; 58 case "denied": 59 $smarty->display("templates/message_denied.html"); 60 break; 61 case "activate": 62 $smarty->display("templates/message_activate.html"); 63 break; 64 default: 65 $smarty->display("templates/message_default.html"); 66 break; 61 case "failed_validation": 62 $errmsg .= "<p>" . sprintf(_("You have failed to validate your account in %d minutes."), (User::getCurrentUser()->getNetwork()->getValidationGraceTime() / 60)) . "</p>"; 63 $errmsg .= "<p>" . _("Please validate your account from somewhere else or create a new one.") . "</p>"; 64 $ui->displayError($errmsg); 65 break; 66 67 case "denied": 68 $errmsg .= _("Access denied!"); 69 $ui->displayError($errmsg); 70 break; 71 72 case "activate": 73 $errmsg .= "<p>" . sprintf(_("You have now been granted %d minutes of Internet access without being validated to go and activate your account."), (User::getCurrentUser()->getNetwork()->getValidationGraceTime() / 60)) . "</p>"; 74 $errmsg .= "<p>" . _("If you fail to validate your account in 15 minutes, you will have to validate it from somewhere else.") . "</p>"; 75 $errmsg .= "<p>" . _("If you do not receive an email from our validation server in the next minute, perhaps you have made a typo in your email address, you might have to create another account.") . "</p>"; 76 $ui->displayError($errmsg); 77 break; 78 79 default: 80 $errmsg .= _("No message has been specified! (this is probably an error)"); 81 $ui->displayError($errmsg); 82 break; 67 83 } 68 84 } else { 69 $smarty->display("templates/message_default.html"); 85 $errmsg .= _("No message has been specified! (this is probably an error)"); 86 $ui->displayError($errmsg); 70 87 } 71 88 -
trunk/wifidog-auth/wifidog/login/index.php
r952 r979 130 130 131 131 catch (Exception $e) { 132 $smarty->assign("error", $e->getMessage()); 133 $smarty->assign("tech_support_email", Network::getCurrentNetwork()->getTechSupportEmail()); 134 $smarty->display("templates/generic_error.html"); 132 $ui = new MainUI(); 133 $ui->displayError($e->getMessage()); 135 134 exit; 136 135 } -
trunk/wifidog-auth/wifidog/portal/index.php
r974 r979 40 40 * @author Philippe April 41 41 * @author Benoit Gregoire <bock@step.polymtl.ca> 42 * @author Max Horvath <max.horvath@maxspot.de> 42 43 * @copyright 2004-2006 Philippe April 43 44 * @copyright 2004-2006 Benoit Gregoire, Technologies Coeus inc. 45 * @copyright 2006 Max Horvath, maxspot GmbH 44 46 * @version Subversion $Id$ 45 47 * @link http://www.wifidog.org/ … … 56 58 require_once('classes/Session.php'); 57 59 58 /** 59 * Define width of toolbar 60 * 61 * Must match the stylesheet for the tool section width 62 */ 63 define('TOOLBAR_WIDTH', '250'); 60 /* 61 * Check for missing URL switch 62 */ 63 if (isset($_REQUEST['missing']) && $_REQUEST['missing'] == "url") { 64 $ui = new MainUI(); 65 $ui->displayError(_('For some reason, we were unable to determine the web site you initially wanted to see. You should now enter a web address in your URL bar.'), false); 66 exit; 67 } 64 68 65 69 // Init values … … 73 77 $current_user = User::getCurrentUser(); 74 78 75 if (!empty ($_REQUEST['gw_id'])) { 76 $node = Node :: getObject($_REQUEST['gw_id']); 77 } 78 79 if ($node == null) { 80 $smarty->display("templates/message_unknown_hotspot.html"); 79 /* 80 * Start general request parameter processing section 81 */ 82 if (!empty($_REQUEST['gw_id'])) { 83 try { 84 $node = Node::getObject($_REQUEST['gw_id']); 85 $network = $node->getNetwork(); 86 } 87 88 catch (Exception $e) { 89 $ui = new MainUI(); 90 $ui->displayError($e->getMessage()); 91 exit; 92 } 93 } else { 94 $ui = new MainUI(); 95 $ui->displayError(_("No Hotspot specified!")); 81 96 exit; 82 97 } 83 84 // Get information about current network85 $network = $node->getNetwork();86 98 87 99 /* … … 90 102 */ 91 103 $custom_portal_url = $node->getCustomPortalRedirectUrl(); 104 92 105 if (!empty($custom_portal_url) && $network->getCustomPortalRedirectAllowed()) { 93 106 header("Location: {$custom_portal_url}"); … … 96 109 $node_id = $node->getId(); 97 110 $portal_template = $node_id.".html"; 98 Node :: setCurrentNode($node); 99 100 $ui = new MainUI(); 101 if (isset ($session)) 102 { 103 if(!empty($_REQUEST['gw_id'])) 111 Node::setCurrentNode($node); 112 113 if (isset($session)) { 114 if (!empty($_REQUEST['gw_id'])) { 104 115 $session->set(SESS_GW_ID_VAR, $_REQUEST['gw_id']); 105 106 } 107 108 $tool_html = ''; 109 110 $tool_html .= "<h1>"._("Online users")."</h1>"."\n"; 111 $tool_html .= '<p class="indent">'."\n"; 112 $current_node = Node :: getCurrentNode(); 113 if ($current_node != null) 114 { 115 $current_node_id = $current_node->getId(); 116 $online_users = $current_node->getOnlineUsers(); 117 $num_online_users = count($online_users); 118 if ($num_online_users > 0) 119 { 120 //$tool_html .= $num_online_users.' '._("other users online at this hotspot..."); 121 $tool_html .= "<ul class='users_list'>\n"; 122 foreach($online_users as $online_user) { 123 $tool_html .= "<li>"; 124 $tool_html .= $online_user->getUsername(); 125 $roles = array(); 126 if ($current_node->isOwner($online_user)) 127 $roles[] = _("owner"); 128 if ($current_node->isTechnicalOfficer($online_user)) 129 $roles[] = _("technical officer"); 130 if ($roles) 131 $tool_html .= " <span class='roles'>(" . join($roles, ",") . ")</span>"; 132 $tool_html .= "</li>\n"; 133 } 134 $tool_html .= "</ul>\n"; 135 } 136 else 137 { 138 $tool_html .= _("Nobody is online at this hotspot..."); 139 } 140 } 141 else 142 { 143 $network = Network::getCurrentNetwork(); 144 $current_node_id = null; 145 $tool_html .= _("You are not currently at a hotspot..."); 146 } 147 $tool_html .= "</p>"."\n"; 148 149 $tool_html .= '<script type="text/javascript"> 150 function getElementById(id) { 151 if (document.all) { 152 return document.getElementById(id); 153 } 154 for (i=0;i<document.forms.length;i++) { 155 if (document.forms[i].elements[id]) {return document.forms[i].elements[id]; } 156 } 157 } 158 159 function getWindowSize(window) { 160 var size_array = new Array(2); 161 var myWidth = 0, myHeight = 0; 162 if( typeof( window.innerWidth ) == "number" ) { 163 //Non-IE 164 myWidth = window.innerWidth; 165 myHeight = window.innerHeight; 166 } else if( document.documentElement && 167 ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { 168 //IE 6+ in "standards compliant mode" 169 myWidth = document.documentElement.clientWidth; 170 myHeight = document.documentElement.clientHeight; 171 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { 172 //IE 4 compatible 173 myWidth = document.body.clientWidth; 174 myHeight = document.body.clientHeight; 175 } 176 size_array[0] = myWidth; 177 size_array[1] = myHeight; 178 // window.alert( "Width = " + myWidth ); 179 // window.alert( "Height = " + myHeight ); 180 return size_array; 181 } 182 183 184 </script>'; 185 186 187 $tool_html .= '<p class="indent">'."\n"; 188 $tool_html .= "<a id='wifidog_portal_expand' onclick=\" 189 var wifidog_portal_expand = getElementById('wifidog_portal_expand'); 190 var wifidog_portal_collapse = getElementById('wifidog_portal_collapse'); 191 192 wifidog_portal_expand.style.display = 'none'; 193 wifidog_portal_collapse.style.display = 'inline'; 194 var size_array = getWindowSize(window.opener); 195 window.resizeTo(size_array[0],size_array[1]); 196 \">"._("Expand portal")."</a>"."\n"; 197 198 $tool_html .= "<a id='wifidog_portal_collapse' onclick=\" 199 var wifidog_portal_expand = getElementById('wifidog_portal_expand'); 200 var wifidog_portal_collapse = getElementById('wifidog_portal_collapse'); 201 202 wifidog_portal_expand.style.display = 'inline'; 203 wifidog_portal_collapse.style.display = 'none'; 204 var size_array = getWindowSize(window.opener); 205 window.resizeTo('".TOOLBAR_WIDTH."',size_array[1]); 206 207 \">"._("Collapse portal")."</a>"."\n"; 208 $tool_html .= "</p>"."\n"; 209 210 211 212 213 $original_url_requested=$session->get(SESS_ORIGINAL_URL_VAR); 214 if(empty($original_url_requested)) 215 { 216 $url="missing_original_url.php"; 217 } 218 else 219 { 220 $url=$original_url_requested; 221 } 222 $tool_html .= '<p class="indent">'."\n"; 223 $tool_html .= "<a id='wifidog_use_internet' href='$url' onclick=\" 224 var size_array = getWindowSize(window); 225 var original_location=window.location.href; 226 //this.target='_blank'; 227 var old_window = window; 228 var new_window = window.open('".CURRENT_REQUEST_URL."','wifidog_portal'); 229 new_window.blur(); 230 old_window.focus(); 231 new_window.resizeTo('".TOOLBAR_WIDTH."',size_array[1]); 232 233 //old_window.location.href='test'; 234 //window.moveBy(300, 300); 235 /*if(window.open){alert('window.open enabled');} 236 else{alert('window.open DISABLED');}*/ 237 238 \"><img src='" . BASE_SSL_PATH . "images/start.gif'></a>\n"; 239 $tool_html .= "</p>"."\n"; 240 241 $tool_html .= '<script type="text/javascript"> 242 //Set up if expand/collapse functionnality is to be enabled by checking if we were called from another portal window. 243 244 window.is_wifidog_portal=true; //This assignement may be read by another window 245 246 var wifidog_portal_expand = document.getElementById("wifidog_portal_expand"); 247 var wifidog_portal_collapse = document.getElementById("wifidog_portal_collapse"); 248 var wifidog_use_internet = document.getElementById("wifidog_use_internet"); 249 if(window.opener && window.opener.is_wifidog_portal==true) 250 { 251 wifidog_portal_expand.style.display = "inline"; 252 wifidog_portal_collapse.style.display = "none"; 253 wifidog_use_internet.style.display = "none"; 254 } 255 else 256 { 257 wifidog_portal_expand.style.display = "none"; 258 wifidog_portal_collapse.style.display = "none"; 259 } 260 </script>'; 261 262 $ui->setToolContent($tool_html); 263 264 $hotspot_network_name = $network->getName(); 265 $hotspot_network_url = $network->getHomepageURL(); 266 $network_logo_url = COMMON_CONTENT_URL.NETWORK_LOGO_NAME; 267 $network_logo_banner_url = COMMON_CONTENT_URL.NETWORK_LOGO_BANNER_NAME; 268 269 $html = ''; 116 } 117 } 118 119 $current_node = Node::getCurrentNode(); 120 $current_node_id = $current_node->getId(); 121 122 // Init ALL smarty SWITCH values 123 $smarty->assign('sectionTOOLCONTENT', false); 124 $smarty->assign('sectionMAINCONTENT', false); 125 126 // Init ALL smarty values 127 $smarty->assign('currentNode', null); 128 $smarty->assign('numOnlineUsers', 0); 129 $smarty->assign('onlineUsers', array()); 130 $smarty->assign('userIsAtHotspot', false); 131 $smarty->assign('noUrl', true); 132 $smarty->assign('url', ""); 133 $smarty->assign('accountValidation', false); 134 $smarty->assign('validationTime', 20); 135 $smarty->assign('hotspotNetworkUrl', ""); 136 $smarty->assign('hotspotNetworkName', ""); 137 $smarty->assign('networkLogoBannerUrl', ""); 138 $smarty->assign('networkContents', false); 139 $smarty->assign('networkContentArray', array()); 140 $smarty->assign('nodeHomepage', false); 141 $smarty->assign('nodeURL', ""); 142 $smarty->assign('nodeName', ""); 143 $smarty->assign('nodeContents', false); 144 $smarty->assign('nodeContentArray', array()); 145 $smarty->assign('userContents', false); 146 $smarty->assign('userContentArray', array()); 147 148 /* 149 * Tool content 150 */ 151 152 // Set section of Smarty template 153 $smarty->assign('sectionTOOLCONTENT', true); 154 155 // Set details about node 156 $smarty->assign('currentNode', $current_node); 157 158 // Set details about onlineusers 159 $online_users = $current_node->getOnlineUsers(); 160 $num_online_users = count($online_users); 161 162 foreach ($online_users as $online_user) { 163 $roles = array(); 164 165 if ($current_node->isOwner($online_user)) { 166 $roles[] = _("owner"); 167 } 168 169 if ($current_node->isTechnicalOfficer($online_user)) { 170 $roles[] = _("technical officer"); 171 } 172 173 if ($roles) { 174 $rolenames = join($roles, ","); 175 } 176 177 $online_user_array[] = array('Username' => $online_user->getUsername(), 'showRoles' => count($roles) > 0, 'roles' => $rolenames); 178 } 179 180 $smarty->assign('numOnlineUsers', $num_online_users); 181 182 if ($num_online_users > 0) { 183 $smarty->assign('onlineUsers', $online_user_array); 184 } 185 186 // Check for requested URL and if user is at a hotspot 187 $original_url_requested = $session->get(SESS_ORIGINAL_URL_VAR); 188 189 $smarty->assign('userIsAtHotspot', Node::getCurrentRealNode() != null ? true : false); 190 191 if (empty($original_url_requested)) { 192 $smarty->assign('noUrl', true); 193 $smarty->assign('url', "?missing=url"); 194 } else { 195 $smarty->assign('noUrl', true); 196 $smarty->assign('url', $original_url_requested); 197 } 198 199 // Compile HTML code 200 $tool_html = $smarty->fetch("templates/sites/portal.tpl"); 201 202 /* 203 * Main content 204 */ 205 206 // Reset ALL smarty SWITCH values 207 $smarty->assign('sectionTOOLCONTENT', false); 208 $smarty->assign('sectionMAINCONTENT', false); 209 210 // Set section of Smarty template 211 $smarty->assign('sectionMAINCONTENT', true); 270 212 271 213 // While in validation period, alert user that he should validate his account ASAP 272 if($current_user && $current_user->getAccountStatus() == ACCOUNT_STATUS_VALIDATION) 273 $html .= "<div id='warning_message_area'>"._('An email with confirmation instructions was sent to your email address. Your account has been granted 15 minutes of access to retrieve your email and validate your account.')."</div>"; 274 275 $html .= "<div id='portal_container'>\n"; 276 277 278 /* Network section */ 279 280 $html .= "<div class='portal_network_section'>\n"; 281 $html .= "<a href='{$hotspot_network_url}'><img class='portal_section_logo' alt='{$hotspot_network_name} logo' src='{$network_logo_banner_url}' border='0'></a>\n"; 214 if ($current_user && $current_user->getAccountStatus() == ACCOUNT_STATUS_VALIDATION) { 215 $smarty->assign('accountValidation', true); 216 $smarty->assign('validationTime', ($current_user->getNetwork()->getValidationGraceTime() / 60)); 217 } 218 219 /* 220 * Network section 221 */ 222 223 // Set network details 224 $smarty->assign('hotspotNetworkUrl', $network->getHomepageURL()); 225 $smarty->assign('hotspotNetworkName', $network->getName()); 226 $smarty->assign('networkLogoBannerUrl', COMMON_CONTENT_URL . NETWORK_LOGO_BANNER_NAME); 227 282 228 // Get all network content and EXCLUDE user subscribed content 283 if($current_user) 284 $contents = Network :: getCurrentNetwork()->getAllContent(true, $current_user); 285 else 286 $contents = Network :: getCurrentNetwork()->getAllContent(); 287 if ($contents) 288 { 289 foreach ($contents as $content) 290 { 291 if ($content->isDisplayableAt($node)) 292 { 293 $html .= "<div class='portal_content'>\n"; 294 $html .= $content->getUserUI(); 295 $html .= "</div>\n"; 296 } 297 } 298 } 299 $html .= "</div>\n"; 300 301 /* Node section */ 229 if ($current_user) { 230 $contents = Network::getCurrentNetwork()->getAllContent(true, $current_user); 231 } else { 232 $contents = Network::getCurrentNetwork()->getAllContent(); 233 } 234 235 if ($contents) { 236 foreach ($contents as $content) { 237 $contentArray[] = array('isDisplayableAt' => $content->isDisplayableAt($node), 'userUI' => $content->getUserUI()); 238 } 239 240 // Set all content of current node 241 $smarty->assign('networkContents', true); 242 $smarty->assign('networkContentArray', $contentArray); 243 } 244 245 /* 246 * Node section 247 */ 248 302 249 // Get all node content and EXCLUDE user subscribed content 303 if ($current_user)250 if ($current_user) { 304 251 $contents = $node->getAllContent(true, $current_user); 305 else 252 } else { 306 253 $contents = $node->getAllContent(); 307 308 if(!empty($contents)) 309 { 310 $html .= "<div class='portal_node_section'>\n"; 311 $html .= "<span class='portal_section_title'>"._("Content from:")." "; 312 $node_homepage = $node->getHomePageURL(); 313 if (!empty ($node_homepage)) 314 { 315 $html .= "<a href='$node_homepage'>"; 316 } 317 $html .= $node->getName(); 318 if (!empty ($node_homepage)) 319 { 320 $html .= "</a>\n"; 321 } 322 $html .= "</span>"; 323 foreach ($contents as $content) 324 { 254 } 255 256 // Set homepage details of node 257 $node_homepage = $node->getHomePageURL(); 258 if (!empty($node_homepage)) { 259 $smarty->assign('nodeHomepage', true); 260 $smarty->assign('nodeURL', $node_homepage); 261 $smarty->assign('nodeName', $node->getName()); 262 } 263 264 if ($contents) { 265 foreach ($contents as $content) { 325 266 // Check for content requirements to show the "Show all contents" link 326 267 if (!$show_more_link) { … … 334 275 } 335 276 336 if ($content->isDisplayableAt($node)) { 337 $html .= "<div class='portal_content'>\n"; 338 $html .= $content->getUserUI(); 339 $html .= "</div>\n"; 277 $contentArray[] = array('isDisplayableAt' => $content->isDisplayableAt($node), 'userUI' => $content->getUserUI()); 278 } 279 280 // Set all content of current node 281 $smarty->assign('nodeContents', true); 282 $smarty->assign('nodeContentArray', $contentArray); 283 } 284 285 /* 286 * User section 287 */ 288 289 if ($current_user) { 290 $contents = User::getCurrentUser()->getAllContent(); 291 292 if ($contents) { 293 foreach ($contents as $content) { 294 $contentArray[] = array('userUI' => $content->getUserUI()); 340 295 } 341 } 342 $html .= "</div>\n"; 343 } 344 345 /* User section */ 346 if($current_user) 347 { 348 $contents = User :: getCurrentUser()->getAllContent(); 349 if($contents) 350 { 351 $html .= "<div class='portal_user_section'>\n"; 352 $html .= "<h1>"._("My content")."</h1>\n"; 353 foreach ($contents as $content) 354 { 355 $html .= "<div class='portal_content'>\n"; 356 $html .= $content->getUserUI(); 357 $html .= "</div>\n"; 358 } 359 $html .= "</div>\n"; 296 297 // Set all content of current node 298 $smarty->assign('userContents', true); 299 $smarty->assign('userContentArray', $contentArray); 360 300 } 361 301 } … … 363 303 // Hyperlinks to full content display page 364 304 if ($show_more_link) { 365 $html .= "<a href='" . BASE_SSL_PATH . "content/?gw_id={$current_node_id}'>"._("Show all available contents for this hotspot")."</a>"."\n"; 366 } 367 368 $html .= "<div style='clear:both;'></div>"; 369 $html .= "</div>\n"; 370 371 $ui->setMainContent($html); 305 $smarty->assign('showMoreLink', true); 306 $smarty->assign('currentNodeId', $current_node_id); 307 } 308 309 // Compile HTML code 310 $html_body = $smarty->fetch("templates/sites/portal.tpl"); 311 312 /* 313 * Render output 314 */ 315 316 $ui = new MainUI(); 317 $ui->setToolContent($tool_html); 318 $ui->setMainContent($html_body); 372 319 $ui->display(); 373 320 -
trunk/wifidog-auth/wifidog/templates/generic_error.html
r933 r979 1 <p> 2 {$error} 3 </p> 1 <div id="warning_message_area">{$error}</div> 4 2 5 <p> 6 {"Please get in touch with "|_} <a href="mailto:{$tech_support_email}">{$tech_support_email}</a>. 7 </p> 3 {if $show_tech_support_email} 4 <p>{"Please get in touch with "|_} <a href="mailto:{$tech_support_email}">{$tech_support_email}</a>.</p> 5 {/if}
