Changeset 1030
- Timestamp:
- 05/09/06 16:01:17 (7 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 32 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/admin/generic_object_admin.php (modified) (1 diff)
-
wifidog/admin/hotspot_location_map.php (modified) (1 diff)
-
wifidog/admin/import_user_database.php (modified) (1 diff)
-
wifidog/admin/index.php (modified) (1 diff)
-
wifidog/admin/online_users.php (modified) (1 diff)
-
wifidog/admin/stats.php (modified) (1 diff)
-
wifidog/admin/user_log.php (modified) (1 diff)
-
wifidog/change_password.php (modified) (2 diffs)
-
wifidog/classes/Content.php (modified) (1 diff)
-
wifidog/classes/MainUI.php (modified) (24 diffs)
-
wifidog/classes/NodeLists/NodeListHTML.php (modified) (1 diff)
-
wifidog/content/PatternLanguage/archives.php (modified) (1 diff)
-
wifidog/content/PatternLanguage/hotspots.php (modified) (1 diff)
-
wifidog/content/PatternLanguage/index.php (modified) (1 diff)
-
wifidog/content/PatternLanguage/narrative.php (modified) (1 diff)
-
wifidog/content/PatternLanguage/subscription.php (modified) (1 diff)
-
wifidog/content/index.php (modified) (2 diffs)
-
wifidog/faq.php (modified) (1 diff)
-
wifidog/help.php (modified) (1 diff)
-
wifidog/hotspots_map.php (modified) (1 diff)
-
wifidog/index.php (modified) (1 diff)
-
wifidog/login/index.php (modified) (1 diff)
-
wifidog/lost_password.php (modified) (2 diffs)
-
wifidog/lost_username.php (modified) (2 diffs)
-
wifidog/node_list.php (modified) (1 diff)
-
wifidog/portal/index.php (modified) (8 diffs)
-
wifidog/resend_validation.php (modified) (2 diffs)
-
wifidog/signup.php (modified) (2 diffs)
-
wifidog/templates/classes/MainUI_Display.tpl (modified) (5 diffs)
-
wifidog/user_profile.php (modified) (1 diff)
-
wifidog/validate.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1029 r1030 1 2006-05-09 Benoit Grégoire <bock@step.polymtl.ca> 2 * Finish content assignation system 3 * Content ordering is now global (network, nodes and everywhere content cand now be in mixed order). 4 * Implement 'everywhere' content 5 * Change MainUI::apendContent to MainUI::addContent 6 1 7 2006-04-28 François Proulx <francois.proulx@gmail.com> 2 8 * Fixed error in initial data script -
trunk/wifidog-auth/wifidog/admin/generic_object_admin.php
r1025 r1030 427 427 $ui->setHtmlHeader($_htmlHeader); 428 428 $ui->setToolSection('ADMIN'); 429 $ui->a ppendContent('main_area_middle', "<div>" . $html . "</div>");429 $ui->addContent('main_area_middle', "<div>" . $html . "</div>"); 430 430 $ui->display(); 431 431 -
trunk/wifidog-auth/wifidog/admin/hotspot_location_map.php
r1009 r1030 71 71 $html .= "<div id=\"map_frame\"></div>\n"; 72 72 $html .= "<input type='button' value='"._("Use these coordinates")."' onClick='setLocationInOriginalWindow();'>\n"; 73 $ui->a ppendContent('main_area_middle', $html);73 $ui->addContent('main_area_middle', $html); 74 74 75 75 if($node->getGisLocation() !== null) -
trunk/wifidog-auth/wifidog/admin/import_user_database.php
r1009 r1030 264 264 $ui=new MainUI(); 265 265 $ui->setToolSection('ADMIN'); 266 $ui->a ppendContent('main_area_middle', $html);266 $ui->addContent('main_area_middle', $html); 267 267 $ui->display(); 268 268 -
trunk/wifidog-auth/wifidog/admin/index.php
r1009 r1030 67 67 } 68 68 69 $ui->a ppendContent('main_area_middle', $html);69 $ui->addContent('main_area_middle', $html); 70 70 $ui->display(); 71 71 -
trunk/wifidog-auth/wifidog/admin/online_users.php
r1009 r1030 59 59 $ui = new MainUI(); 60 60 $ui->setToolSection('ADMIN'); 61 $ui->a ppendContent('main_area_middle', $smarty->fetch("admin/templates/online_users.html"));61 $ui->addContent('main_area_middle', $smarty->fetch("admin/templates/online_users.html")); 62 62 $ui->display(); 63 63 -
trunk/wifidog-auth/wifidog/admin/stats.php
r1009 r1030 125 125 $ui = new MainUI(); 126 126 $ui->setToolSection('ADMIN'); 127 $ui->a ppendContent('main_area_middle', $html);127 $ui->addContent('main_area_middle', $html); 128 128 $ui->display(); 129 129 -
trunk/wifidog-auth/wifidog/admin/user_log.php
r1009 r1030 121 121 $ui=new MainUI(); 122 122 $ui->setToolSection('ADMIN'); 123 $ui->a ppendContent('main_area_middle', $html);123 $ui->addContent('main_area_middle', $html); 124 124 $ui->display(); 125 125 } -
trunk/wifidog-auth/wifidog/change_password.php
r1018 r1030 131 131 132 132 $ui = new MainUI(); 133 $ui->a ppendContent('main_area_middle', $smarty->fetch("templates/sites/validate.tpl"));133 $ui->addContent('main_area_middle', $smarty->fetch("templates/sites/validate.tpl")); 134 134 $ui->display(); 135 135 … … 154 154 $ui = new MainUI(); 155 155 $smarty->assign('SelectNetworkUI', Network::getSelectNetworkUI('auth_source')); 156 $ui->a ppendContent('main_area_middle', $smarty->fetch("templates/change_password.html"));156 $ui->addContent('main_area_middle', $smarty->fetch("templates/change_password.html")); 157 157 $ui->display(); 158 158 -
trunk/wifidog-auth/wifidog/classes/Content.php
r1013 r1030 969 969 } 970 970 971 /** Is this Content element displayable at this hotspot, many classe roverride this971 /** Is this Content element displayable at this hotspot, many classes override this 972 972 * @param $node Node, optionnal 973 973 * @return true or false */ -
trunk/wifidog-auth/wifidog/classes/MainUI.php
r1018 r1030 70 70 */ 71 71 class MainUI { 72 /**73 * Available structural display areas where content can be placed74 *75 * @var array76 * @access private77 */78 private $available_display_areas;79 72 80 73 /** … … 84 77 * @access private 85 78 */ 86 private $contentArray; 79 private $_contentDisplayArray; 80 81 /** 82 * Content to be displayed on the page, before ordering 83 * 84 * @var array 85 * @access private 86 */ 87 private $_contentArray; 87 88 88 89 /** … … 104 105 * Additional class of the <body> of the HTML page 105 106 */ 106 private $ page_name;107 private $_pageName; 107 108 108 109 /** … … 112 113 * @access private 113 114 */ 114 private $ html_headers;115 private $_htmlHeaders; 115 116 116 117 /** … … 120 121 * @access private 121 122 */ 122 private $ tool_section_enabled = true;123 private $_toolSectionEnabled = true; 123 124 124 125 /** … … 128 129 * @access private 129 130 */ 130 private $ footer_scripts = array ();131 132 private $shrink_left_area = false;131 private $_footerScripts = array (); 132 133 private $_shrinkLeftArea = false; 133 134 134 135 /** … … 151 152 $db->execSql($current_content_sql, $rows, false); 152 153 foreach ($rows as $row) { 153 $this-> contentArray[$row['display_area']] = '';154 $this->_contentDisplayArray[$row['display_area']] = ''; 154 155 } 155 156 } … … 163 164 * 164 165 * @param string $content HTML content to be added to the area 165 * 166 * @return void 167 */ 168 public function appendContent($display_area, $content) { 169 if (!isset ($this->contentArray[$display_area])) { 170 throw new exception(sprintf(_('%s is not a valid structural display area'), $display_area)); 171 } 172 $this->contentArray[$display_area] .= $content; 166 * 167 * @param integer $display_order_index The order in which the content should 168 * be displayed 169 * 170 * @return void 171 */ 172 public function addContent($displayArea, $content, $displayOrderIndex = 1) { 173 //echo "MainUI::addContent(): Debug: displayArea: $displayArea, displayOrderIndex: $displayOrderIndex, content: $content<br/>"; 174 if (!isset ($this->_contentDisplayArray[$displayArea])) { 175 throw new exception(sprintf(_('%s is not a valid structural display area'), $displayArea)); 176 } 177 $this->_contentArray[] = array ('display_area' => $displayArea, 'display_order' => $displayOrderIndex, 'content' => $content); 178 } 179 180 /** Private compare function for sorting the _contentArray() */ 181 private static function _contentArrayCmp($a, $b) { 182 if ($a['display_order'] == $b['display_order']) { 183 return 0; 184 } 185 return ($a['display_order'] < $b['display_order']) ? -1 : 1; 186 } 187 188 /** 189 * Orders the content and put it in the _contentDisplayArray array 190 * 191 * @return void 192 */ 193 private function generateDisplayContent() { 194 //pretty_print_r($this->_contentArray); 195 usort($this->_contentArray, array ('MainUI', '_contentArrayCmp')); 196 foreach ($this->_contentArray as $content_fragment) { 197 $this->_contentDisplayArray[$content_fragment['display_area']] .= $content_fragment['content']; 198 } 199 200 } 201 202 /** 203 * Add the content marked "everywhere" from both the current node and the 204 * current network. 205 * 206 * @return void 207 */ 208 private function addEverywhereContent() { 209 global $db; 210 // Get all network content and node "everywhere" content 211 $content_rows = null; 212 $network_id = $db->escapeString(Network :: getCurrentNetwork()->getId()); 213 $sql_network = "(SELECT content_id, display_area, display_order, subscribe_timestamp FROM network_has_content WHERE network_id='$network_id' AND display_page='everywhere') "; 214 $node = Node :: getCurrentNode(); 215 $sql_node = null; 216 if ($node) { 217 // Get all node content 218 $node_id = $db->escapeString($node->getId()); 219 $sql_node = "UNION (SELECT content_id, display_area, display_order, subscribe_timestamp FROM node_has_content WHERE node_id='$node_id' AND display_page='everywhere')"; 220 } 221 $sql = "SELECT * FROM ($sql_network $sql_node) AS content_everywhere ORDER BY display_area, display_order, subscribe_timestamp DESC"; 222 223 $db->execSql($sql, $content_rows, false); 224 if ($content_rows) { 225 foreach ($content_rows as $content_row) { 226 $content = Content :: getObject($content_row['content_id']); 227 if ($content->isDisplayableAt($node)) { 228 $this->addContent($content_row['display_area'], $content->getUserUI(), $content_row['display_order']); 229 } 230 } 231 } 232 233 } 234 235 /** 236 * Check if the tool section is enabled 237 * 238 * @return bool True or false 239 * 240 * @access public 241 */ 242 public function isToolSectionEnabled() { 243 return $this->_toolSectionEnabled; 173 244 } 174 245 … … 180 251 * @access public 181 252 */ 182 public function isToolSectionEnabled() {183 return $this->tool_section_enabled;184 }185 186 /**187 * Check if the tool section is enabled188 *189 * @return bool True or false190 *191 * @access public192 */193 253 public function setToolSectionEnabled($status) { 194 $this-> tool_section_enabled = $status;254 $this->_toolSectionEnabled = $status; 195 255 } 196 256 … … 209 269 210 270 public function shrinkLeftArea() { 211 $this->shrink_left_area = true;212 }271 $this->_shrinkLeftArea = true; 272 } 213 273 214 274 /** … … 222 282 */ 223 283 public function setPageName($page_name_string) { 224 $this-> page_name = $page_name_string;284 $this->_pageName = $page_name_string; 225 285 } 226 286 … … 240 300 */ 241 301 public function addFooterScript($script) { 242 $this-> footer_scripts[] = $script;302 $this->_footerScripts[] = $script; 243 303 } 244 304 … … 253 313 */ 254 314 public function setHtmlHeader($headers_string) { 255 $this-> html_headers = $headers_string;315 $this->_htmlHeaders = $headers_string; 256 316 } 257 317 … … 281 341 // The user has no permission to access the administrative functions 282 342 $_html = _("You do not have permissions to access any administration functions."); 283 } else { 343 } 344 else { 284 345 // Init values 285 346 $_sqlAdditionalWhere = ""; 286 347 287 348 // Init ALL smarty values 288 User::assignSmartyValues($this->smarty, $_currentUser);349 User :: assignSmartyValues($this->smarty, $_currentUser); 289 350 $this->smarty->assign('formAction', ""); 290 351 $this->smarty->assign('nodeUI', ""); … … 327 388 } 328 389 329 $this->a ppendContent('left_area_middle', $_html);390 $this->addContent('left_area_middle', $_html); 330 391 } 331 392 … … 338 399 */ 339 400 private function getToolContent() { 340 // Define globals341 global $session;401 // Define globals 402 global $session; 342 403 global $AVAIL_LOCALE_ARRAY; 343 404 … … 354 415 $this->smarty->assign('sectionLOGIN', false); 355 416 356 // Set section of Smarty template 357 $this->smarty->assign('sectionSTART', true); 358 359 // Get information about user 360 $_currentUser = User :: getCurrentUser(); 361 362 User::assignSmartyValues($this->smarty, $_currentUser); 363 364 $this->smarty->assign('logoutParameters', ""); 365 $this->smarty->assign('loginParameters', ""); 366 $this->smarty->assign('formAction', ""); 367 $this->smarty->assign('toolContent', ""); 368 $this->smarty->assign('accountInformation', ""); 369 $this->smarty->assign('techSupportInformation', ""); 370 $this->smarty->assign('shrinkLeftArea', $this->shrink_left_area); 371 372 // Provide Smarty with information about the network 373 Network::assignSmartyValues($this->smarty); 374 375 /* 376 * Provide Smarty information about the user's login/logout status 377 */ 378 379 if ($_currentUser != null) { 380 // User is logged in 381 382 // Detect gateway information 383 $_gwId = $session->get(SESS_GW_ID_VAR); 384 $_gwAddress = $session->get(SESS_GW_ADDRESS_VAR); 385 $_gwPort = $session->get(SESS_GW_PORT_VAR); 386 387 // If gateway information could be detected tell them Smarty 388 if ($_gwId && $_gwAddress && $_gwPort) { 389 $this->smarty->assign('logoutParameters', "&gw_id=".$_gwId."&gw_address=".$_gwAddress."&gw_port=".$_gwPort); 390 } 391 } else { 392 // Detect gateway information 393 $_gwId = !empty ($_REQUEST['gw_id']) ? $_REQUEST['gw_id'] : $session->get(SESS_GW_ID_VAR); 394 $_gwAddress = !empty ($_REQUEST['gw_address']) ? $_REQUEST['gw_address'] : $session->get(SESS_GW_ADDRESS_VAR); 395 $_gwPort = !empty ($_REQUEST['gw_port']) ? $_REQUEST['gw_port'] : $session->get(SESS_GW_PORT_VAR); 396 397 // If gateway information could be detected tell them Smarty 398 if (!empty ($_gwId) && !empty ($_gwAddress) && !empty ($_gwPort)) { 399 $this->smarty->assign('loginParameters', "?gw_id=".$_gwId."&gw_address=".$_gwAddress."&gw_port=".$_gwPort); 400 } 401 } 402 403 /* 404 * Provide Smarty information for the language chooser 405 */ 406 407 // Assign the action URL for the form 408 $this->smarty->assign('formAction', $_SERVER['REQUEST_URI']); 409 410 foreach ($AVAIL_LOCALE_ARRAY as $_langIds => $_langNames) { 411 if (Locale :: getCurrentLocale()->getId() == $_langIds) { 412 $_selected = ' selected="selected"'; 413 } else { 414 $_selected = ""; 415 } 416 417 $_languageChooser[] = '<option label="'.$_langNames.'" value="'.$_langIds.'"'.$_selected.'>'.$_langNames.'</option>'; 418 } 419 420 // Provide Smarty all available languages 421 $this->smarty->assign('languageChooser', $_languageChooser); 422 423 /* 424 * Provide Smarty information for the language chooser 425 */ 426 427 // Provide information 428 $this->smarty->assign('accountInformation', sprintf(_("Accounts on %s are and will stay completely free."), Network :: getCurrentNetwork()->getName())); 429 $this->smarty->assign('techSupportInformation', sprintf(_("Please inform us of any problem or service interruption at: %s"), '<a href="mailto:'.Network :: getCurrentNetwork()->getTechSupportEmail().'">'.Network :: getCurrentNetwork()->getTechSupportEmail().'</a>')); 430 431 // Compile HTML code 432 $_html = $this->smarty->fetch("templates/classes/MainUI_ToolContent.tpl"); 433 417 // Set section of Smarty template 418 $this->smarty->assign('sectionSTART', true); 419 420 // Get information about user 421 $_currentUser = User :: getCurrentUser(); 422 423 User :: assignSmartyValues($this->smarty, $_currentUser); 424 425 $this->smarty->assign('logoutParameters', ""); 426 $this->smarty->assign('loginParameters', ""); 427 $this->smarty->assign('formAction', ""); 428 $this->smarty->assign('toolContent', ""); 429 $this->smarty->assign('accountInformation', ""); 430 $this->smarty->assign('techSupportInformation', ""); 431 $this->smarty->assign('shrinkLeftArea', $this->_shrinkLeftArea); 432 433 // Provide Smarty with information about the network 434 Network :: assignSmartyValues($this->smarty); 435 436 /* 437 * Provide Smarty information about the user's login/logout status 438 */ 439 440 if ($_currentUser != null) { 441 // User is logged in 442 443 // Detect gateway information 444 $_gwId = $session->get(SESS_GW_ID_VAR); 445 $_gwAddress = $session->get(SESS_GW_ADDRESS_VAR); 446 $_gwPort = $session->get(SESS_GW_PORT_VAR); 447 448 // If gateway information could be detected tell them Smarty 449 if ($_gwId && $_gwAddress && $_gwPort) { 450 $this->smarty->assign('logoutParameters', "&gw_id=".$_gwId."&gw_address=".$_gwAddress."&gw_port=".$_gwPort); 451 } 452 } 453 else { 454 // Detect gateway information 455 $_gwId = !empty ($_REQUEST['gw_id']) ? $_REQUEST['gw_id'] : $session->get(SESS_GW_ID_VAR); 456 $_gwAddress = !empty ($_REQUEST['gw_address']) ? $_REQUEST['gw_address'] : $session->get(SESS_GW_ADDRESS_VAR); 457 $_gwPort = !empty ($_REQUEST['gw_port']) ? $_REQUEST['gw_port'] : $session->get(SESS_GW_PORT_VAR); 458 459 // If gateway information could be detected tell them Smarty 460 if (!empty ($_gwId) && !empty ($_gwAddress) && !empty ($_gwPort)) { 461 $this->smarty->assign('loginParameters', "?gw_id=".$_gwId."&gw_address=".$_gwAddress."&gw_port=".$_gwPort); 462 } 463 } 464 465 /* 466 * Provide Smarty information for the language chooser 467 */ 468 469 // Assign the action URL for the form 470 $this->smarty->assign('formAction', $_SERVER['REQUEST_URI']); 471 472 foreach ($AVAIL_LOCALE_ARRAY as $_langIds => $_langNames) { 473 if (Locale :: getCurrentLocale()->getId() == $_langIds) { 474 $_selected = ' selected="selected"'; 475 } 476 else { 477 $_selected = ""; 478 } 479 480 $_languageChooser[] = '<option label="'.$_langNames.'" value="'.$_langIds.'"'.$_selected.'>'.$_langNames.'</option>'; 481 } 482 483 // Provide Smarty all available languages 484 $this->smarty->assign('languageChooser', $_languageChooser); 485 486 /* 487 * Provide Smarty information for the language chooser 488 */ 489 490 // Provide information 491 $this->smarty->assign('accountInformation', sprintf(_("Accounts on %s are and will stay completely free."), Network :: getCurrentNetwork()->getName())); 492 $this->smarty->assign('techSupportInformation', sprintf(_("Please inform us of any problem or service interruption at: %s"), '<a href="mailto:'.Network :: getCurrentNetwork()->getTechSupportEmail().'">'.Network :: getCurrentNetwork()->getTechSupportEmail().'</a>')); 493 494 // Compile HTML code 495 $_html = $this->smarty->fetch("templates/classes/MainUI_ToolContent.tpl"); 496 434 497 return $_html; 435 498 } … … 446 509 */ 447 510 public function display() { 511 448 512 // Init values 449 513 $_stylesheetFile = ""; … … 461 525 462 526 // Add HTML headers 463 $this->smarty->assign('htmlHeaders', $this-> html_headers);527 $this->smarty->assign('htmlHeaders', $this->_htmlHeaders); 464 528 465 529 // Asign title … … 467 531 468 532 // Asign CSS class for body 469 $this->smarty->assign('page_name', $this-> page_name);533 $this->smarty->assign('page_name', $this->_pageName); 470 534 471 535 // Asign path to CSS stylesheet … … 477 541 if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.STYLESHEET_NAME)) { 478 542 $_stylesheetFile = NODE_CONTENT_SMARTY_PATH.STYLESHEET_NAME; 479 } else { 543 } 544 else { 480 545 $_stylesheetFile = DEFAULT_CONTENT_SMARTY_PATH.STYLESHEET_NAME; 481 546 } … … 490 555 491 556 // Get information about user 492 User::assignSmartyValues($this->smarty); 493 494 $this->appendContent('page_header', $this->customBanner()); 495 557 User :: assignSmartyValues($this->smarty); 558 559 //Handle content 560 561 $this->addContent('page_header', $this->customBanner()); 496 562 /* 497 563 * Build tool pane if it has been enabled 498 564 */ 499 565 if ($this->isToolSectionEnabled()) { 500 $this->appendContent('left_area_top', $this->getToolContent()); 501 } 502 566 $this->addContent('left_area_top', $this->getToolContent()); 567 } 568 $this->addEverywhereContent(); 569 $this->generateDisplayContent(); 503 570 // Provide the content array to Smarty 504 $this->smarty->assign('content Array', $this->contentArray);571 $this->smarty->assign('contentDisplayArray', $this->_contentDisplayArray); 505 572 506 573 // Provide footer scripts to Smarty 507 $this->smarty->assign('footerScripts', $this-> footer_scripts);574 $this->smarty->assign('footerScripts', $this->_footerScripts); 508 575 509 576 // Compile HTML code and output it … … 523 590 */ 524 591 function displayError($errmsg, $show_tech_support_email = true) { 525 // Init ALL smarty values526 $this->smarty->assign("error", "");592 // Init ALL smarty values 593 $this->smarty->assign("error", ""); 527 594 $this->smarty->assign("show_tech_support_email", false); 528 595 $this->smarty->assign("tech_support_email", ""); … … 541 608 $_html = $this->smarty->fetch("templates/sites/error.tpl"); 542 609 543 $this->a ppendContent('page_header', $_html);610 $this->addContent('page_header', $_html); 544 611 $this->display(); 545 612 } 546 613 547 static public function redirect($redirect_url, $redirect_to_title=null, $timeout=60) { 548 if (!$redirect_to_title) { 549 $network = Network :: getCurrentNetwork(); 550 $redirect_to_title = $network ? sprintf(_("%s Login"), $network->getName()) : _("Login"); 551 } 552 553 header("Location: $redirect_url"); 554 echo "<html>\n" . 555 "<head><meta http-equiv='Refresh' content='$timeout; URL=$redirect_url'/></head>\n". 556 "<body>\n" . 557 "<noscript>\n" . 558 "<span style='display:none;'>\n" . 559 "<h1>" . $redirect_to_title . "</h1>\n" . 560 sprintf(_("Click <a href='%s'>here</a> to continue"), $redirect_url) . "<br/>\n" . 561 _("The transfer from secure login back to regular http may cause a warning.") . "\n" . 562 "</span>\n" . 563 "</noscript>\n" . 564 "</body>\n" . 565 "</html>\n" 566 ; 567 exit; 568 } 569 570 public function customBanner() { 571 $custom_banner = ''; 572 573 return $custom_banner; 574 } 614 static public function redirect($redirect_url, $redirect_to_title = null, $timeout = 60) { 615 if (!$redirect_to_title) { 616 $network = Network :: getCurrentNetwork(); 617 $redirect_to_title = $network ? sprintf(_("%s Login"), $network->getName()) : _("Login"); 618 } 619 620 header("Location: $redirect_url"); 621 echo "<html>\n"."<head><meta http-equiv='Refresh' content='$timeout; URL=$redirect_url'/></head>\n"."<body>\n"."<noscript>\n"."<span style='display:none;'>\n"."<h1>".$redirect_to_title."</h1>\n".sprintf(_("Click <a href='%s'>here</a> to continue"), $redirect_url)."<br/>\n"._("The transfer from secure login back to regular http may cause a warning.")."\n"."</span>\n"."</noscript>\n"."</body>\n"."</html>\n"; 622 exit; 623 } 624 625 public function customBanner() { 626 $custom_banner = ''; 627 628 return $custom_banner; 629 } 575 630 } 576 631 -
trunk/wifidog-auth/wifidog/classes/NodeLists/NodeListHTML.php
r1013 r1030 232 232 $this->_mainUI->setTitle(_("Hotspot list")); 233 233 $this->_mainUI->SetHtmlHeader('<link rel="alternate" type="application/rss+xml" title="' . $this->_network->getName() . ": " . _("Newest Hotspots") . '" href="' . BASE_SSL_PATH . 'hotspot_status.php?format=RSS">'); 234 $this->_mainUI->a ppendContent('left_area_middle', $_html);235 $this->_mainUI->a ppendContent('main_area_middle', $_html_body);234 $this->_mainUI->addContent('left_area_middle', $_html); 235 $this->_mainUI->addContent('main_area_middle', $_html_body); 236 236 237 237 $this->_mainUI->display(); -
trunk/wifidog-auth/wifidog/content/PatternLanguage/archives.php
r1009 r1030 98 98 99 99 $ui = new MainUI(); 100 $ui->a ppendContent('left_area_middle', $tool_html);100 $ui->addContent('left_area_middle', $tool_html); 101 101 $ui->setTitle(_("Pattern Language - Archives")); 102 $ui->a ppendContent('main_area_middle', $body_html);102 $ui->addContent('main_area_middle', $body_html); 103 103 $ui->display(); 104 104 -
trunk/wifidog-auth/wifidog/content/PatternLanguage/hotspots.php
r1009 r1030 103 103 104 104 $ui=new MainUI(); 105 $ui->a ppendContent('left_area_middle', $tool_html);105 $ui->addContent('left_area_middle', $tool_html); 106 106 $ui->setTitle(_("Pattern Language - Hotspots list")); 107 $ui->a ppendContent('main_area_middle', $body_html);107 $ui->addContent('main_area_middle', $body_html); 108 108 $ui->display(); 109 109 -
trunk/wifidog-auth/wifidog/content/PatternLanguage/index.php
r1009 r1030 93 93 94 94 $ui=new MainUI(); 95 $ui->a ppendContent('left_area_middle', $tool_html);95 $ui->addContent('left_area_middle', $tool_html); 96 96 $ui->setTitle(_("Pattern Language - About")); 97 $ui->a ppendContent('main_area_middle', $body_html);97 $ui->addContent('main_area_middle', $body_html); 98 98 $ui->display(); 99 99 -
trunk/wifidog-auth/wifidog/content/PatternLanguage/narrative.php
r1009 r1030 114 114 115 115 $ui = new MainUI(); 116 $ui->a ppendContent('left_area_middle', $tool_html);116 $ui->addContent('left_area_middle', $tool_html); 117 117 $ui->setTitle(_("Pattern Language - Narrative")); 118 $ui->a ppendContent('main_area_middle', $body_html);118 $ui->addContent('main_area_middle', $body_html); 119 119 $ui->display(); 120 120 -
trunk/wifidog-auth/wifidog/content/PatternLanguage/subscription.php
r1009 r1030 142 142 143 143 $ui = new MainUI(); 144 $ui->a ppendContent('left_area_middle', $tool_html);144 $ui->addContent('left_area_middle', $tool_html); 145 145 $ui->setTitle(_("Pattern Language - Subscription")); 146 $ui->a ppendContent('main_area_middle', $body_html);146 $ui->addContent('main_area_middle', $body_html); 147 147 $ui->display(); 148 148 -
trunk/wifidog-auth/wifidog/content/index.php
r1009 r1030 114 114 $tool_html .= "</p>"."\n"; 115 115 */ 116 $ui->a ppendContent('left_area_middle', $tool_html);116 $ui->addContent('left_area_middle', $tool_html); 117 117 118 118 … … 149 149 } 150 150 151 $ui->a ppendContent('main_area_middle', $html);151 $ui->addContent('main_area_middle', $html); 152 152 $ui->display(); 153 153 -
trunk/wifidog-auth/wifidog/faq.php
r1009 r1030 53 53 54 54 $ui = new MainUI(); 55 $ui->a ppendContent('main_area_middle', $smarty->fetch("templates/faq.html"));55 $ui->addContent('main_area_middle', $smarty->fetch("templates/faq.html")); 56 56 $ui->display(); 57 57 -
trunk/wifidog-auth/wifidog/help.php
r1020 r1030 58 58 59 59 $ui = new MainUI(); 60 $ui->a ppendContent('main_area_middle', $smarty->fetch("templates/sites/help.tpl"));60 $ui->addContent('main_area_middle', $smarty->fetch("templates/sites/help.tpl")); 61 61 $ui->display(); 62 62 -
trunk/wifidog-auth/wifidog/hotspots_map.php
r1024 r1030 169 169 $ui->setTitle(_("Hotspots status map")); 170 170 $ui->setHtmlHeader($html_headers); 171 $ui->a ppendContent('left_area_middle', $html);172 $ui->a ppendContent('main_area_middle', $html_body);171 $ui->addContent('left_area_middle', $html); 172 $ui->addContent('main_area_middle', $html_body); 173 173 $ui->addFooterScript($script); 174 174 $ui->display(); -
trunk/wifidog-auth/wifidog/index.php
r1018 r1030 103 103 */ 104 104 $ui = new MainUI(); 105 $ui->a ppendContent('left_area_middle', $html);106 $ui->a ppendContent('main_area_middle', $html_body);105 $ui->addContent('left_area_middle', $html); 106 $ui->addContent('main_area_middle', $html_body); 107 107 $ui->display(); 108 108 -
trunk/wifidog-auth/wifidog/login/index.php
r1028 r1030 262 262 $ui->setPageName('login'); 263 263 $ui->shrinkLeftArea(); 264 $ui->a ppendContent('left_area_middle', $html);264 $ui->addContent('left_area_middle', $html); 265 265 266 266 /* 267 267 * Main content 268 268 */ 269 // Get all network content 270 $content_rows = null; 271 $network_id = $db->escapeString($network->getId());272 $sql = "SELECT content_id, display_area FROM network_has_content WHERE network_id='$network_id' AND display_page='login' ORDER BY display_area, display_order, subscribe_timestamp DESC";273 $db->execSql($sql, $content_rows, false);274 if ($content_rows) { 275 foreach ($content_rows as $content_row) {276 $content = Content :: getObject($content_row['content_id']);277 if ($content->isDisplayableAt($node)) {278 $ ui->appendContent($content_row['display_area'], $content->getUserUI());269 270 // Get all network content and node "login" content 271 $content_rows = null; 272 $network_id = $network->getId(); 273 $sql_network = "(SELECT content_id, display_area, display_order, subscribe_timestamp FROM network_has_content WHERE network_id='$network_id' AND display_page='login') "; 274 $sql_node = null; 275 if ($node) { 276 // Get all node content 277 $node_id = $db->escapeString($node->getId()); 278 $sql_node = "UNION (SELECT content_id, display_area, display_order, subscribe_timestamp FROM node_has_content WHERE node_id='$node_id' AND display_page='login')"; 279 279 } 280 } 281 } 282 283 if($node) 284 { 285 // Get all node content 286 $content_rows = null; 287 $node_id = $db->escapeString($node->getId()); 288 $sql = "SELECT content_id, display_area FROM node_has_content WHERE node_id='$node_id' AND display_page='login' ORDER BY display_area, display_order, subscribe_timestamp DESC"; 289 $db->execSql($sql, $content_rows, false); 290 $showMoreLink = false; 291 if ($content_rows) { 292 foreach ($content_rows as $content_row) { 293 $content = Content :: getObject($content_row['content_id']); 294 if ($content->isDisplayableAt($node)) { 295 $ui->appendContent($content_row['display_area'], $content->getUserUI()); 280 $sql = "SELECT * FROM ($sql_network $sql_node) AS content_everywhere ORDER BY display_area, display_order, subscribe_timestamp DESC"; 281 282 $db->execSql($sql, $content_rows, false); 283 if ($content_rows) { 284 foreach ($content_rows as $content_row) { 285 $content = Content :: getObject($content_row['content_id']); 286 if ($content->isDisplayableAt($node)) { 287 $ui->addContent($content_row['display_area'], $content->getUserUI(), $content_row['display_order']); 288 } 289 } 296 290 } 297 }298 }299 }300 301 $ui->appendContent('main_area_middle',302 "\n<h1>" . sprintf(_("Welcome to the %s Hotspot network."), $network->getName()) . "</h1>\n" .303 304 "<p>" .305 _("Please use the login/signup form on the left to activate your connection with the internet.") .306 "</p>\n".307 308 "<p>" .309 _("If you already have an account please use that to login.") . " " .310 _("Thanks to the hospitality of your proprietor, this is a surfing free zone.") . " " .311 _("Once you login you are welcome to use the internet as long as you like.") .312 "</p>\n" .313 314 "<p>" .315 sprintf(_("If you are new to %s, please use the form on the left to create a new account."), $network->getName()) . " " .316 _("There will be no charge for this service.") .317 "</p>\n"318 );319 291 320 292 /* -
trunk/wifidog-auth/wifidog/lost_password.php
r1018 r1030 141 141 */ 142 142 $ui = new MainUI(); 143 $ui->a ppendContent('left_area_middle', $html);144 $ui->a ppendContent('main_area_middle', $html_body);143 $ui->addContent('left_area_middle', $html); 144 $ui->addContent('main_area_middle', $html_body); 145 145 $ui->display(); 146 146 … … 211 211 */ 212 212 $ui = new MainUI(); 213 $ui->a ppendContent('left_area_middle', $html);214 $ui->a ppendContent('main_area_middle', $html_body);213 $ui->addContent('left_area_middle', $html); 214 $ui->addContent('main_area_middle', $html_body); 215 215 $ui->display(); 216 216 -
trunk/wifidog-auth/wifidog/lost_username.php
r1018 r1030 125 125 */ 126 126 $ui = new MainUI(); 127 $ui->a ppendContent('left_area_middle', $html);128 $ui->a ppendContent('main_area_middle', $html_body);127 $ui->addContent('left_area_middle', $html); 128 $ui->addContent('main_area_middle', $html_body); 129 129 $ui->display(); 130 130 … … 195 195 */ 196 196 $ui = new MainUI(); 197 $ui->a ppendContent('left_area_middle', $html);198 $ui->a ppendContent('main_area_middle', $html_body);197 $ui->addContent('left_area_middle', $html); 198 $ui->addContent('main_area_middle', $html_body); 199 199 $ui->display(); 200 200 -
trunk/wifidog-auth/wifidog/node_list.php
r1009 r1030 133 133 134 134 $ui = new MainUI(); 135 $ui->a ppendContent('main_area_middle', $smarty->fetch("templates/node_list.html"));135 $ui->addContent('main_area_middle', $smarty->fetch("templates/node_list.html")); 136 136 $ui->display(); 137 137 -
trunk/wifidog-auth/wifidog/portal/index.php
r1009 r1030 211 211 $ui->setTitle(sprintf(_("%s portal for %s"), $network->getName(), $node->getName())); 212 212 $ui->setPageName('portal'); 213 $ui->a ppendContent('left_area_middle', $tool_html);213 $ui->addContent('left_area_middle', $tool_html); 214 214 /* 215 215 * Main content … … 221 221 $validationMsgHtml .= sprintf(_("Your account has been granted %s minutes of access to retrieve your email and validate your account."), ($current_user->getNetwork()->getValidationGraceTime() / 60)); 222 222 $validationMsgHtml .= "</div>\n"; 223 $ui->a ppendContent('page_header', $validationMsgHtml);223 $ui->addContent('page_header', $validationMsgHtml); 224 224 } 225 225 … … 229 229 if ($current_user) { 230 230 $user_id = $db->escapeString($current_user->getId()); 231 $sql = "SELECT content_id, display_area FROM network_has_content WHERE network_id='$network_id' AND display_page='portal' AND content_id NOT IN (SELECT content_id FROM user_has_content WHERE user_id = '{$user_id}') ORDER BY display_area, display_order, subscribe_timestamp DESC";231 $sql = "SELECT content_id, display_area, display_order FROM network_has_content WHERE network_id='$network_id' AND display_page='portal' AND content_id NOT IN (SELECT content_id FROM user_has_content WHERE user_id = '{$user_id}') ORDER BY display_area, display_order, subscribe_timestamp DESC"; 232 232 } else { 233 $sql = "SELECT content_id, display_area FROM network_has_content WHERE network_id='$network_id' AND display_page='portal' ORDER BY display_area, display_order, subscribe_timestamp DESC";233 $sql = "SELECT content_id, display_area, display_order FROM network_has_content WHERE network_id='$network_id' AND display_page='portal' ORDER BY display_area, display_order, subscribe_timestamp DESC"; 234 234 } 235 235 $db->execSql($sql, $content_rows, false); … … 238 238 $content = Content :: getObject($content_row['content_id']); 239 239 if ($content->isDisplayableAt($node)) { 240 $ui->a ppendContent($content_row['display_area'], $content->getUserUI());240 $ui->addContent($content_row['display_area'], $content->getUserUI(), $content_row['display_order']); 241 241 } 242 242 } … … 248 248 if ($current_user) { 249 249 $user_id = $db->escapeString($current_user->getId()); 250 $sql = "SELECT content_id, display_area FROM node_has_content WHERE node_id='$node_id' AND display_page='portal' AND content_id NOT IN (SELECT content_id FROM user_has_content WHERE user_id = '{$user_id}') ORDER BY display_area, display_order, subscribe_timestamp DESC";250 $sql = "SELECT content_id, display_area, display_order FROM node_has_content WHERE node_id='$node_id' AND display_page='portal' AND content_id NOT IN (SELECT content_id FROM user_has_content WHERE user_id = '{$user_id}') ORDER BY display_area, display_order, subscribe_timestamp DESC"; 251 251 } else { 252 $sql = "SELECT content_id, display_area FROM node_has_content WHERE node_id='$node_id' AND display_page='portal' ORDER BY display_area, display_order, subscribe_timestamp DESC";252 $sql = "SELECT content_id, display_area, display_order FROM node_has_content WHERE node_id='$node_id' AND display_page='portal' ORDER BY display_area, display_order, subscribe_timestamp DESC"; 253 253 } 254 254 $db->execSql($sql, $content_rows, false); … … 258 258 $content = Content :: getObject($content_row['content_id']); 259 259 if ($content->isDisplayableAt($node)) { 260 $ui->a ppendContent($content_row['display_area'], $content->getUserUI());260 $ui->addContent($content_row['display_area'], $content->getUserUI(), $content_row['display_order']); 261 261 } 262 262 // Check for content requirements to show the "Show all contents" link … … 283 283 $content = Content :: getObject($content_row['content_id']); 284 284 if ($content->isDisplayableAt($node)) { 285 $ui->a ppendContent('main_area_middle', $content->getUserUI());285 $ui->addContent('main_area_middle', $content->getUserUI()); 286 286 } 287 287 } … … 291 291 if ($showMoreLink) { 292 292 $link_html = "<a href='{$base_ssl_path}content/?gw_id={$currentNodeId}'>"._("Show all available contents for this hotspot")."</a>\n"; 293 $ui->a ppendContent('main_area_middle', $link_html);293 $ui->addContent('main_area_middle', $link_html); 294 294 } 295 295 $ui->display(); -
trunk/wifidog-auth/wifidog/resend_validation.php
r1018 r1030 124 124 */ 125 125 $ui = new MainUI(); 126 $ui->a ppendContent('left_area_middle', $html);127 $ui->a ppendContent('main_area_middle', $html_body);126 $ui->addContent('left_area_middle', $html); 127 $ui->addContent('main_area_middle', $html_body); 128 128 $ui->display(); 129 129 … … 194 194 */ 195 195 $ui = new MainUI(); 196 $ui->a ppendContent('left_area_middle', $html);197 $ui->a ppendContent('main_area_middle', $html_body);196 $ui->addContent('left_area_middle', $html); 197 $ui->addContent('main_area_middle', $html_body); 198 198 $ui->display(); 199 199 -
trunk/wifidog-auth/wifidog/signup.php
r1018 r1030 258 258 $ui = new MainUI(); 259 259 260 $ui->a ppendContent('left_area_middle', $html);261 $ui->a ppendContent('main_area_middle', $html_body);262 263 // $ui->a ppendContent('page_header', $validationMsgHtml);264 $ui->a ppendContent('main_area_top', $validationMsgHtml);260 $ui->addContent('left_area_middle', $html); 261 $ui->addContent('main_area_middle', $html_body); 262 263 // $ui->addContent('page_header', $validationMsgHtml); 264 $ui->addContent('main_area_top', $validationMsgHtml); 265 265 266 266 $ui->display(); … … 345 345 */ 346 346 $ui = new MainUI(); 347 $ui->a ppendContent('left_area_middle', $html);348 $ui->a ppendContent('main_area_middle', $html_body);347 $ui->addContent('left_area_middle', $html); 348 $ui->addContent('main_area_middle', $html_body); 349 349 $ui->display(); 350 350 -
trunk/wifidog-auth/wifidog/templates/classes/MainUI_Display.tpl
r1020 r1030 68 68 69 69 <body id='page' class='{$page_name}'> 70 {if !empty($content Array.page_header) || $debugRequested}70 {if !empty($contentDisplayArray.page_header) || $debugRequested} 71 71 <div class='page_header'> 72 72 {if $debugRequested} 73 73 <pre>{$debugOutput}</pre> 74 74 {/if} 75 {if !empty($content Array.page_header)}76 {$content Array.page_header}75 {if !empty($contentDisplayArray.page_header)} 76 {$contentDisplayArray.page_header} 77 77 {/if} 78 78 </div> … … 81 81 82 82 <div id="page_body"> 83 {if !empty($content Array.left_area_top) || !empty($contentArray.left_area_middle) || !empty($contentArray.left_area_middle)}83 {if !empty($contentDisplayArray.left_area_top) || !empty($contentDisplayArray.left_area_middle) || !empty($contentDisplayArray.left_area_middle)} 84 84 <div id="left_area"> 85 {if !empty($content Array.left_area_top)}85 {if !empty($contentDisplayArray.left_area_top)} 86 86 <div id="left_area_top"> 87 {$content Array.left_area_top}87 {$contentDisplayArray.left_area_top} 88 88 </div> 89 89 {/if} 90 {if !empty($content Array.left_area_middle)}90 {if !empty($contentDisplayArray.left_area_middle)} 91 91 <div id="left_area_middle"> 92 {$content Array.left_area_middle}92 {$contentDisplayArray.left_area_middle} 93 93 </div> 94 94 {/if} 95 {if !empty($content Array.left_area_bottom)}95 {if !empty($contentDisplayArray.left_area_bottom)} 96 96 <div id="left_area_bottom"> 97 {$content Array.left_area_bottom}97 {$contentDisplayArray.left_area_bottom} 98 98 </div> 99 99 {/if} … … 101 101 {/if} 102 102 103 {if !empty($content Array.main_area_top) || !empty($contentArray.main_area_middle) || !empty($contentArray.main_area_middle)}103 {if !empty($contentDisplayArray.main_area_top) || !empty($contentDisplayArray.main_area_middle) || !empty($contentDisplayArray.main_area_middle)} 104 104 <div id="main_area"> 105 {if !empty($content Array.main_area_top)}105 {if !empty($contentDisplayArray.main_area_top)} 106 106 <div id="main_area_top"> 107 {$content Array.main_area_top}107 {$contentDisplayArray.main_area_top} 108 108 </div> 109 109 {/if} 110 {if !empty($content Array.main_area_middle)}110 {if !empty($contentDisplayArray.main_area_middle)} 111 111 <div id="main_area_middle"> 112 {$content Array.main_area_middle}112 {$contentDisplayArray.main_area_middle} 113 113 </div> 114 114 {/if} 115 {if !empty($content Array.main_area_bottom)}115 {if !empty($contentDisplayArray.main_area_bottom)} 116 116 <div id="main_area_bottom"> 117 {$content Array.main_area_bottom}117 {$contentDisplayArray.main_area_bottom} 118 118 </div> 119 119 {/if} … … 121 121 {/if} 122 122 123 {if !empty($content Array.right_area_top) || !empty($contentArray.right_area_middle) || !empty($contentArray.right_area_bottom)}123 {if !empty($contentDisplayArray.right_area_top) || !empty($contentDisplayArray.right_area_middle) || !empty($contentDisplayArray.right_area_bottom)} 124 124 <div id="right_area"> 125 {if !empty($content Array.right_area_top)}125 {if !empty($contentDisplayArray.right_area_top)} 126 126 <div id="right_area_top"> 127 {$content Array.right_area_top}127 {$contentDisplayArray.right_area_top} 128 128 </div> 129 129 {/if} 130 {if !empty($content Array.right_area_middle)}130 {if !empty($contentDisplayArray.right_area_middle)} 131 131 <div id="right_area_middle"> 132 {$content Array.right_area_middle}132 {$contentDisplayArray.right_area_middle} 133 133 </div> 134 134 {/if} 135 {if !empty($content Array.right_area_bottom)}135 {if !empty($contentDisplayArray.right_area_bottom)} 136 136 <div id="right_area_bottom"> 137 {$content Array.right_area_bottom}137 {$contentDisplayArray.right_area_bottom} 138 138 </div> 139 139 {/if} … … 141 141 {/if} 142 142 </div> 143 {if !empty($content Array.page_footer)}143 {if !empty($contentDisplayArray.page_footer)} 144 144 <div class='page_footer'> 145 {$content Array.page_footer}145 {$contentDisplayArray.page_footer} 146 146 </div> 147 147 {/if} -
trunk/wifidog-auth/wifidog/user_profile.php
r1009 r1030 80 80 81 81 $ui=new MainUI(); 82 $ui->a ppendContent('left_area_middle', $tool_html);82 $ui->addContent('left_area_middle', $tool_html); 83 83 $smarty->assign("title", _("User Profile")); 84 84 //TODO: Write User profiles 85 $ui->a ppendContent('main_area_middle', $body_html);85 $ui->addContent('main_area_middle', $body_html); 86 86 $ui->display(); 87 87 -
trunk/wifidog-auth/wifidog/validate.php
r1009 r1030 86 86 87 87 $ui = new MainUI(); 88 $ui->a ppendContent('main_area_middle', $smarty->fetch("templates/sites/validate.tpl"));88 $ui->addContent('main_area_middle', $smarty->fetch("templates/sites/validate.tpl")); 89 89 $ui->display(); 90 90
