Changeset 1018
- Timestamp:
- 04/23/06 10:09:18 (7 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 3 added
- 30 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/auth/index.php (modified) (2 diffs)
-
wifidog/change_password.php (modified) (3 diffs)
-
wifidog/classes/MainUI.php (modified) (11 diffs)
-
wifidog/classes/Network.php (modified) (1 diff)
-
wifidog/classes/NodeLists/NodeListRSS.php (modified) (2 diffs)
-
wifidog/classes/SmartyWifidog.php (modified) (1 diff)
-
wifidog/classes/User.php (modified) (1 diff)
-
wifidog/help.php (added)
-
wifidog/include/common.php (modified) (2 diffs)
-
wifidog/include/path_defines_url_content.php (modified) (4 diffs)
-
wifidog/index.php (modified) (2 diffs)
-
wifidog/js/formutils.js (added)
-
wifidog/local_content/default/stylesheet.css (modified) (3 diffs)
-
wifidog/locale/de/LC_MESSAGES/messages.po (modified) (1 diff)
-
wifidog/locale/fr/LC_MESSAGES/messages.po (modified) (1 diff)
-
wifidog/locale/pt/LC_MESSAGES/messages.po (modified) (1 diff)
-
wifidog/login/index.php (modified) (12 diffs)
-
wifidog/lost_password.php (modified) (1 diff)
-
wifidog/lost_username.php (modified) (1 diff)
-
wifidog/resend_validation.php (modified) (2 diffs)
-
wifidog/signup.php (modified) (5 diffs)
-
wifidog/templates/change_password.html (modified) (1 diff)
-
wifidog/templates/classes/MainUI_Display.tpl (modified) (2 diffs)
-
wifidog/templates/classes/MainUI_ToolContent.tpl (modified) (3 diffs)
-
wifidog/templates/classes/MainUI_ToolSection.tpl (modified) (4 diffs)
-
wifidog/templates/sites/help.tpl (added)
-
wifidog/templates/sites/index.tpl (modified) (2 diffs)
-
wifidog/templates/sites/login.tpl (modified) (3 diffs)
-
wifidog/templates/sites/lost_password.tpl (modified) (4 diffs)
-
wifidog/templates/sites/lost_username.tpl (modified) (4 diffs)
-
wifidog/templates/sites/resend_validation.tpl (modified) (4 diffs)
-
wifidog/templates/sites/signup.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1016 r1018 1 2006-04-17 Rob Janes <janes.rob@gmail.com> 2 * javascript for validating and navigating forms. 3 * help text (untranslated). 4 * EVENT_LOGGING enabling/disabling flag. 5 * use SYSTEM_PATH instead of BASE_URL_PATH and BASE_SSL_PATH where ever appropriate. 6 * standardize Smarty variables for Network and User info by adding assignSmartyValues($smarty, $self) to Network and User. 7 * change_password only allowed if logged in. 8 * non-superadmin can only use change_password to change their own password. 9 * superadmin can use change_password to change any user password by entering in their password for the old password. 10 * page_header div defined and positioned in MainUI 11 1 12 2006-04-04 Benoit Grégoire <bock@step.polymtl.ca> 2 13 * /classes/Content/IFrame/IFrame.php: Change a few methods from private to protected as the private methods broke IFrameRest -
trunk/wifidog-auth/wifidog/auth/index.php
r914 r1018 71 71 if (!$authenticator) 72 72 { 73 $auth_message .= "| Error: Unable to instan ciate authenticator. ";73 $auth_message .= "| Error: Unable to instantiate authenticator. "; 74 74 $auth_response = ACCOUNT_STATUS_ERROR; 75 75 } … … 97 97 } 98 98 else 99 if ($info['token_status'] == TOKEN_INUSE && $info['gw_id'] == $_REQUEST['gw_id'] && $info['mac'] == $_REQUEST['mac'] && $info['ip'] == $_REQUEST['ip']) 99 if ($info['token_status'] == TOKEN_INUSE && 100 isset($info['gw_id']) && isset($_REQUEST['gw_id']) && $info['gw_id'] == $_REQUEST['gw_id'] && 101 isset($info['mac']) && isset($_REQUEST['mac']) && $info['mac'] == $_REQUEST['mac'] && 102 isset($info['ip']) && isset($_REQUEST['ip']) && $info['ip'] == $_REQUEST['ip']) 100 103 { 101 104 // This solves the bug where the user clicks twice before getting the portal page -
trunk/wifidog-auth/wifidog/change_password.php
r1009 r1018 55 55 require_once('classes/User.php'); 56 56 57 isset($_REQUEST["username"]) && $smarty->assign("username", $_REQUEST["username"]);57 $smarty->assign('error', ''); 58 58 59 if (isset($_REQUEST["submit"])) { 59 $smarty->assign('username', ''); 60 $smarty->assign('oldpassword', ''); 61 $smarty->assign('newpassword', ''); 62 $smarty->assign('newpassword_again', ''); 63 64 $user = User::getCurrentUser(); 65 if ($user) { 66 User::assignSmartyValues($smarty, $user); 67 68 if ($user->isSuperAdmin() && isset($_REQUEST['username'])) { 69 $smarty->assign('username', $_REQUEST['username']); 70 $username = $_REQUEST['username']; 71 } 72 else 73 $username = $user->getUsername(); 74 75 // $user->getEmail(); 76 // $user->getRealName(); 77 // $user->getWebsiteURL(); 78 // $user->isSuperAdmin(); 79 // $user->isOwner(); 80 } 81 else { 82 $smarty->assign('error', _("You must login before you can change your password.")); 83 } 84 85 if ($user && isset($_REQUEST["form_request"])) { 60 86 try { 61 87 // If the source is present and that it's in our, save it to a var for later use … … 64 90 if (!$account_origin || !$_REQUEST["username"] || !$_REQUEST["oldpassword"] || !$_REQUEST["newpassword"] || !$_REQUEST["newpassword_again"]) 65 91 throw new Exception(_('You MUST fill in all the fields.')); 66 $username = $db->escapeString(trim($_REQUEST['username'])); 92 67 93 $current_password = $db->escapeString(trim($_REQUEST['oldpassword'])); 68 94 $new_password = $db->escapeString(trim($_REQUEST['newpassword'])); … … 75 101 76 102 // Warning for now, password change only works for local users, registered through our signup process. 77 $user = User::getUserByUsernameAndOrigin($username, $account_origin); 78 if ($user->getPasswordHash() != User::passwordHash($current_password)) 79 throw new Exception(_("Wrong password.")); 103 if ($username == $user->getUsername()) { 104 $victim = $user; 80 105 81 $user->SetPassword($new_password); 106 if ($victim->getPasswordHash() != User::passwordHash($current_password)) 107 throw new Exception(_("Wrong password.")); 108 109 $victim->setPassword($new_password); 110 $smarty->assign("message", _("Your password has been changed succesfully.")); 111 } 112 else { 113 if ($user->isSuperAdmin()) { 114 $username = $db->escapeString(trim($_REQUEST['username'])); 115 $victim = User::getUserByUsernameAndOrigin($username, $account_origin); 116 117 if (!$victim) 118 throw new Exception(sprintf(_('Sorry, user %s does not exist !'), $username)); 119 120 if ($victim->getPasswordHash() != User::passwordHash($current_password) 121 && $user->getPasswordHash() != User::passwordHash($current_password)) 122 throw new Exception(_("Wrong password.")); 123 124 $victim->setPassword($new_password); 125 $smarty->assign("message", sprintf(_('The password for %s has been successfully changed.'), $username)); 126 } 127 else { 128 throw new Exception(_('Sorry, invalid change password request !')); 129 } 130 } 131 82 132 $ui = new MainUI(); 83 $smarty->assign("message", _("Your password has been changed succesfully."));84 133 $ui->appendContent('main_area_middle', $smarty->fetch("templates/sites/validate.tpl")); 85 134 $ui->display(); 135 86 136 exit; 87 137 } catch (Exception $e) { -
trunk/wifidog-auth/wifidog/classes/MainUI.php
r1013 r1018 130 130 private $footer_scripts = array (); 131 131 132 private $shrink_left_area = false; 133 132 134 /** 133 135 * Contructor … … 205 207 $this->title = $title_string; 206 208 } 209 210 public function shrinkLeftArea() { 211 $this->shrink_left_area = true; 212 } 207 213 208 214 /** … … 280 286 281 287 // Init ALL smarty values 282 $this->smarty->assign('isSuperAdmin', false); 283 $this->smarty->assign('isOwner', false); 288 User::assignSmartyValues($this->smarty, $_currentUser); 284 289 $this->smarty->assign('formAction', ""); 285 290 $this->smarty->assign('nodeUI', ""); 286 291 $this->smarty->assign('networkUI', ""); 287 288 // Define user security levels for the template289 $this->smarty->assign('isSuperAdmin', $_currentUser && $_currentUser->isSuperAdmin());290 $this->smarty->assign('isOwner', $_currentUser && $_currentUser->isOwner());291 292 292 293 /* … … 359 360 $_currentUser = User :: getCurrentUser(); 360 361 361 // Init ALL smarty values 362 $this->smarty->assign('networkHomepageURL', ""); 363 $this->smarty->assign('networkName', ""); 364 $this->smarty->assign('isValidUser', false); 365 $this->smarty->assign('username', ""); 362 User::assignSmartyValues($this->smarty, $_currentUser); 363 366 364 $this->smarty->assign('logoutParameters', ""); 367 365 $this->smarty->assign('loginParameters', ""); … … 370 368 $this->smarty->assign('accountInformation', ""); 371 369 $this->smarty->assign('techSupportInformation', ""); 370 $this->smarty->assign('shrinkLeftArea', $this->shrink_left_area); 372 371 373 372 // Provide Smarty with information about the network 374 $this->smarty->assign('networkHomepageURL', Network :: getCurrentNetwork()->getHomepageURL()); 375 $this->smarty->assign('networkName', Network :: getCurrentNetwork()->getName()); 373 Network::assignSmartyValues($this->smarty); 376 374 377 375 /* … … 381 379 if ($_currentUser != null) { 382 380 // User is logged in 383 $this->smarty->assign('isValidUser', true);384 385 // Set username for Smarty386 $this->smarty->assign('username', $_currentUser->getUsername());387 381 388 382 // Detect gateway information … … 447 441 * 448 442 * @access public 449 * @internal Uses a few request parameters to displa ty debug information.443 * @internal Uses a few request parameters to display debug information. 450 444 * If $_REQUEST['debug_request'] is present, it will print out the 451 445 * $_REQUEST array at the top of the page. … … 460 454 $this->smarty->assign('stylesheetURL', ""); 461 455 $this->smarty->assign('stylesheetParsedFile', ""); 462 $this->smarty->assign('isSuperAdmin', false);463 $this->smarty->assign('isOwner', false);456 // $this->smarty->assign('isSuperAdmin', false); 457 // $this->smarty->assign('isOwner', false); 464 458 $this->smarty->assign('debugRequested', false); 465 459 $this->smarty->assign('debugOutput', ""); … … 496 490 497 491 // Get information about user 498 $_currentUser = User :: getCurrentUser(); 499 500 // Define user security levels for the template 501 $this->smarty->assign('isSuperAdmin', $_currentUser && $_currentUser->isSuperAdmin()); 502 $this->smarty->assign('isOwner', $_currentUser && $_currentUser->isOwner()); 503 504 if (isset ($_REQUEST['debug_request']) && ($_currentUser && $_currentUser->isSuperAdmin())) { 505 // Tell Smarty everything it needs to know 506 $this->smarty->assign('debugRequested', true); 507 $this->smarty->assign('debugOutput', print_r($_REQUEST, true)); 508 } 492 User::assignSmartyValues($this->smarty); 493 494 $this->appendContent('page_header', $this->customBanner()); 509 495 510 496 /* … … 537 523 */ 538 524 function displayError($errmsg, $show_tech_support_email = true) { 539 // Init ALL smarty values540 $this->smarty->assign("error", "");525 // Init ALL smarty values 526 $this->smarty->assign("error", ""); 541 527 $this->smarty->assign("show_tech_support_email", false); 542 528 $this->smarty->assign("tech_support_email", ""); … … 559 545 } 560 546 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 } 561 575 } 562 576 -
trunk/wifidog-auth/wifidog/classes/Network.php
r1013 r1018 1627 1627 } 1628 1628 1629 public static function assignSmartyValues($smarty, $net=null) { 1630 if (!$net) $net = Network::getCurrentNetwork(); 1631 1632 $smarty->assign('networkName', $net ? $net->getName() : ''); 1633 $smarty->assign('networkHomepageURL', $net ? $net->getHomepageURL() : ''); 1634 // Set networks usage information 1635 $smarty->assign('networkNumValidUsers', $net ? $net->getNumValidUsers() : 0); 1636 $smarty->assign('networkNumOnlineUsers', $net ? $net->getNumOnlineUsers() : 0); 1637 1638 // Set networks node information 1639 $smarty->assign('networkNumDeployedNodes', $net ? $net->getNumDeployedNodes() : 0); 1640 $smarty->assign('networkNumOnlineNodes', $net ? $net->getNumOnlineNodes() : 0); 1641 } 1629 1642 } 1630 1643 -
trunk/wifidog-auth/wifidog/classes/NodeLists/NodeListRSS.php
r1013 r1018 247 247 248 248 // image 249 if ( file_exists(WIFIDOG_ABS_FILE_PATH . "local_content/common/" . NETWORK_LOGO_NAME)) {249 if (defined('NETWORK_LOGO_NAME') && file_exists(WIFIDOG_ABS_FILE_PATH . "local_content/common/" . constant('NETWORK_LOGO_NAME'))) { 250 250 $_image = $this->_xmldoc->createElement("image"); 251 251 $_channel->appendChild($_image); … … 320 320 if ($_node->getDeploymentStatus() != 'NON_WIFIDOG_NODE') { 321 321 if ($_nodeData['is_up'] == 't') { 322 $_descriptionText .= "<img src='" . BASE_URL_PATH . "images/HotspotStatus/up.gif' alt='' />";322 $_descriptionText .= "<img src='" . SYSTEM_PATH . "images/HotspotStatus/up.gif' alt='' />"; 323 323 } else { 324 $_descriptionText .= "<img src='" . BASE_URL_PATH . "images/HotspotStatus/down.gif' alt='' />";324 $_descriptionText .= "<img src='" . SYSTEM_PATH . "images/HotspotStatus/down.gif' alt='' />"; 325 325 } 326 326 } -
trunk/wifidog-auth/wifidog/classes/SmartyWifidog.php
r1013 r1018 121 121 /* Useful stuff from config.php */ 122 122 123 $this->assign('system_path', SYSTEM_PATH); 123 124 $this->assign('base_url_path', BASE_URL_PATH); 124 125 $this->assign('base_ssl_path', BASE_SSL_PATH); -
trunk/wifidog-auth/wifidog/classes/User.php
r1013 r1018 810 810 } 811 811 812 /** Set Smarty template values. Standardization routine. */ 813 public static function assignSmartyValues($smarty, $user=null) { 814 if (!$user) $user = User::getCurrentUser(); 815 $smarty->assign('username', $user ? $user->getUsername() : ''); 816 817 /** 818 * Define user security levels for the template 819 * 820 * These values are used in the default template of WiFoDog but could be 821 * used in a customized template to restrict certain links to specific 822 * user access levels. 823 */ 824 $smarty->assign('isValidUser', $user ? true : false); 825 $smarty->assign('isSuperAdmin', $user && $user->isSuperAdmin()); 826 $smarty->assign('isOwner', $user && $user->isOwner()); 827 828 if (isset ($_REQUEST['debug_request']) && ($user && $user->isSuperAdmin())) { 829 // Tell Smarty everything it needs to know 830 $smarty->assign('debugRequested', true); 831 $smarty->assign('debugOutput', print_r($_REQUEST, true)); 832 } 833 } 812 834 } 813 835 -
trunk/wifidog-auth/wifidog/include/common.php
r1002 r1018 72 72 require_once('classes/EventLogging.php'); 73 73 74 EventLogging::SetupErrorHandling( "strict~/var:\sDeprecated/(off)", 75 array( 'print' => new PrintChannel(new HTMLFormatter(), 'warning,notice', null, true), 76 'debug' => new PrintChannel(new HTMLCommentsFormatter(), '=debug', null, false) ) 77 ); 74 if (!defined('EVENT_LOGGING') || constant('EVENT_LOGGING')) { 75 EventLogging::SetupErrorHandling( "strict~/var:\sDeprecated/(off)", 76 array( 'print' => new PrintChannel(new HTMLFormatter(), 'warning,notice', null, true), 77 'debug' => new PrintChannel(new HTMLCommentsFormatter(), '=debug', null, false) ) 78 ); 79 } 78 80 require_once('classes/AbstractDb.php'); 79 81 require_once('classes/Locale.php'); … … 371 373 } 372 374 373 $myLogfile = !defined('WIFIDOG_LOGFILE') ? "tmp/wifidog.log" : constant('WIFIDOG_LOGFILE'); 374 if (!empty($myLogfile)) { 375 if (substr($myLogfile,0,1) != '/') $myLogfile = WIFIDOG_ABS_FILE_PATH.$myLogfile; 375 if (!defined('EVENT_LOGGING') || constant('EVENT_LOGGING')) { 376 $myLogfile = !defined('WIFIDOG_LOGFILE') ? "tmp/wifidog.log" : constant('WIFIDOG_LOGFILE'); 377 if (!empty($myLogfile)) { 378 if (substr($myLogfile,0,1) != '/') $myLogfile = WIFIDOG_ABS_FILE_PATH.$myLogfile; 376 379 377 EventLogging::stAddChannel( new FileChannel($myLogfile, new WifidogSyslogFormatter(), 'warning,notice'), 'logfile' ); 378 } 379 380 // trigger_error("here i am", E_USER_NOTICE); 380 EventLogging::stAddChannel( new FileChannel($myLogfile, new WifidogSyslogFormatter(), 'warning,notice'), 'logfile' ); 381 } 382 383 // trigger_error("here i am", E_USER_NOTICE); 384 } 381 385 382 386 /* -
trunk/wifidog-auth/wifidog/include/path_defines_url_content.php
r1009 r1018 52 52 //echo "<pre>";print_r($_SERVER);echo "</pre>"; 53 53 54 $cur ent_url = 'http';54 $current_url = 'http'; 55 55 if ($_SERVER['SERVER_PORT'] == '443') { 56 $cur ent_url .= 's';56 $current_url .= 's'; 57 57 } 58 $cur ent_url .= '://'.$_SERVER['HTTP_HOST'];58 $current_url .= '://'.$_SERVER['HTTP_HOST']; 59 59 if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) 60 $cur ent_url .= ':'.$_SERVER['SERVER_PORT'];61 $cur ent_url .= $_SERVER['REQUEST_URI'];60 $current_url .= ':'.$_SERVER['SERVER_PORT']; 61 $current_url .= $_SERVER['REQUEST_URI']; 62 62 63 63 /** 64 64 * Define current request URL 65 65 */ 66 define('CURRENT_REQUEST_URL', $cur ent_url);66 define('CURRENT_REQUEST_URL', $current_url); 67 67 68 68 if (SSL_AVAILABLE) { … … 82 82 83 83 /* If we actually ARE in SSL mode, make all URLS http:// to avoid security warnings. */ 84 if (isset ($_SERVER['HTTPS'])) { 85 /** 86 * Define base web address to use (this time using SLL) 87 */ 88 define('BASE_URL_PATH', BASE_SSL_PATH); 89 } 90 else { 84 // no no no just use the SYSTEM_PATH ... use /login/index.php rather than http://auth.wirelesstoronto.ca/login/index.php 85 // if (isset ($_SERVER['HTTPS'])) { 86 // /** 87 // * Define base web address to use (this time using SLL) 88 // */ 89 // define('BASE_URL_PATH', BASE_SSL_PATH); 90 // } 91 // else { 91 92 /** 92 93 * Define base web address to use … … 95 96 */ 96 97 define('BASE_URL_PATH', BASE_NON_SSL_PATH); 97 }98 // } 98 99 99 100 /** … … 118 119 * Define URLs 119 120 */ 120 define('NODE_CONTENT_URL', BASE_URL_PATH.LOCAL_CONTENT_REL_PATH.CURRENT_NODE_ID.'/'); 121 // define('NODE_CONTENT_URL', BASE_URL_PATH.LOCAL_CONTENT_REL_PATH.CURRENT_NODE_ID.'/'); 122 define('NODE_CONTENT_URL', SYSTEM_PATH.LOCAL_CONTENT_REL_PATH.CURRENT_NODE_ID.'/'); 121 123 define('NODE_CONTENT_PHP_RELATIVE_PATH', LOCAL_CONTENT_REL_PATH.CURRENT_NODE_ID.'/'); 122 124 123 define('COMMON_CONTENT_URL', BASE_URL_PATH.LOCAL_CONTENT_REL_PATH.'common/'); 125 // define('COMMON_CONTENT_URL', BASE_URL_PATH.LOCAL_CONTENT_REL_PATH.'common/'); 126 define('COMMON_CONTENT_URL', SYSTEM_PATH.LOCAL_CONTENT_REL_PATH.'common/'); 124 127 125 define('GENERIC_OBJECT_ADMIN_ABS_HREF', BASE_URL_PATH.'admin/generic_object_admin.php'); 126 define('CONTENT_ADMIN_ABS_HREF', BASE_URL_PATH.'admin/content_admin.php'); 128 // define('GENERIC_OBJECT_ADMIN_ABS_HREF', BASE_URL_PATH.'admin/generic_object_admin.php'); 129 define('GENERIC_OBJECT_ADMIN_ABS_HREF', SYSTEM_PATH.'admin/generic_object_admin.php'); 130 // define('CONTENT_ADMIN_ABS_HREF', BASE_URL_PATH.'admin/content_admin.php'); 131 define('CONTENT_ADMIN_ABS_HREF', SYSTEM_PATH.'admin/content_admin.php'); 127 132 128 133 ?> -
trunk/wifidog-auth/wifidog/index.php
r1009 r1018 63 63 64 64 // Init ALL smarty values 65 $smarty->assign('isSuperAdmin', false);66 $smarty->assign('isOwner', false);67 $smarty->assign('networkName', "");68 $smarty->assign('networkNumValidUsers', 0);69 $smarty->assign('networkNumOnlineUsers', 0);70 $smarty->assign('networkNumDeployedNodes', 0);71 $smarty->assign('networkNumOnlineNodes', 0);72 65 $smarty->assign('googleMapsEnabled', false); 73 66 74 67 // Get information about network 75 68 $network = Network::getCurrentNetwork(); 69 Network::assignSmartyValues($smarty, $network); 76 70 77 71 // Get information about user 78 $currentUser = User::getCurrentUser(); 79 80 /** 81 * Define user security levels for the template 82 * 83 * These values are used in the default template of WiFoDog but could be used 84 * in a customized template to restrict certain links to specific user 85 * access levels. 86 */ 87 $smarty->assign('isSuperAdmin', $currentUser && $currentUser->isSuperAdmin()); 88 $smarty->assign('isOwner', $currentUser && $currentUser->isOwner()); 72 User::assignSmartyValues($smarty); 89 73 90 74 /* … … 108 92 // Set section of Smarty template 109 93 $smarty->assign('sectionMAINCONTENT', true); 110 111 // Set networks information112 $smarty->assign('networkName', $network->getName());113 114 // Set networks user information115 $smarty->assign('networkNumValidUsers', $network->getNumValidUsers());116 $smarty->assign('networkNumOnlineUsers', $network->getNumOnlineUsers());117 118 // Set networks node information119 $smarty->assign('networkNumDeployedNodes', $network->getNumDeployedNodes());120 $smarty->assign('networkNumOnlineNodes', $network->getNumOnlineNodes());121 94 122 95 // Set Google maps information -
trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css
r883 r1018 11 11 .bodyBackColor { 12 12 {/literal} 13 background : #dbffa8 url({$ base_url_path}images/bg_body.gif) repeat-x fixed 0px 0px;13 background : #dbffa8 url({$system_path}images/bg_body.gif) repeat-x fixed 0px 0px; 14 14 {literal} 15 15 } … … 17 17 div.navigation { 18 18 {/literal} 19 background-image: url({$ base_url_path}images/01_nav.gif);19 background-image: url({$system_path}images/01_nav.gif); 20 20 {literal} 21 21 } … … 23 23 div.avis{ 24 24 {/literal} 25 background-image: url({$ base_url_path}images/03_avis.gif);25 background-image: url({$system_path}images/03_avis.gif); 26 26 {literal} 27 27 } -
trunk/wifidog-auth/wifidog/locale/de/LC_MESSAGES/messages.po
r1001 r1018 1611 1611 1612 1612 #: ../login/index.php:124 ../login/index.php:125 ../login/index.php:197 1613 msgid "You rmust specify your username and password"1613 msgid "You must specify your username and password" 1614 1614 msgstr "Sie müssen ihren Benutzernamen und ihr Passwort angeben" 1615 1615 -
trunk/wifidog-auth/wifidog/locale/fr/LC_MESSAGES/messages.po
r1001 r1018 3097 3097 #: ../login/index.php:125 3098 3098 #: ../login/index.php:197 3099 msgid "You rmust specify your username and password"3099 msgid "You must specify your username and password" 3100 3100 msgstr "Veuillez entrer un nom d'usager et un mot de passe" 3101 3101 -
trunk/wifidog-auth/wifidog/locale/pt/LC_MESSAGES/messages.po
r1001 r1018 2566 2566 2567 2567 #: ../login/index.php:124 ../login/index.php:125 ../login/index.php:197 2568 msgid "You rmust specify your username and password"2568 msgid "You must specify your username and password" 2569 2569 msgstr "Você precisa especificar seu usuário e senha" 2570 2570 -
trunk/wifidog-auth/wifidog/login/index.php
r1013 r1018 39 39 * The login page will both display the login page, and process login and logout 40 40 * request. 41 * 42 * Hotspots redirect newly active PCs to this page with this url: 43 * Refering to the wifidog.conf installed on the hotspot: 44 * 45 * {PROTOCOL}://{HOSTNAME}:{PORT}{PATH}login?gw_address=A&gw_port=P&gw_id=I&url=URL 46 * 47 * PROTOCOL, HOSTNAME, PORT and PATH refer to the settings for the hotspot's 48 * currently selected authserver. 49 * PROTOCOL http or https if SSLAvailable is yes for the hotspot's current authserver 50 * HOSTNAME Hostname of the current authserver 51 * PORT is HTTPPort or SSLPort of the current authserver 52 * PATH is the Path of the current authserver. PATH starts and ends with a / 53 * 54 * gw_address is GatewayAddress from the config file 55 * gw_port is GatewayPort 56 * gw_id is GatewayID, is node id 57 * url is the original url requested but redirected here by the hotspot wifidog 58 * 59 * http://auth.wirelesstoronto.ca:80/login?gw_address=207.50.119.2&gw_port=2060&gw_id=215&url=http://hotmail.com 41 60 * 42 61 * @package WiFiDogAuthServer … … 60 79 require_once('classes/Network.php'); 61 80 require_once('classes/MainUI.php'); 81 // require_once('lib/magpie/rss_fetch.inc'); // Added so RSS code which depends on the Magpie RSS functions will work. // 62 82 63 83 // Init values … … 70 90 $logout = null; 71 91 92 $create_a_free_account = _("Create a free account"); 93 72 94 /* 73 95 * General request parameter processing section … … 101 123 } 102 124 125 if (isset($_REQUEST["form_signup"]) && $_REQUEST["form_signup"] == $create_a_free_account) { 126 MainUI::redirect(SYSTEM_PATH . "signup.php"); 127 exit; 128 } 129 103 130 /* 104 131 * Store original URL typed by user … … 119 146 try { 120 147 $node = Node::getObject($gw_id); 121 $hotspot_name = $node->getName();122 $network = $node->getNetwork();123 148 } 124 149 … … 128 153 exit; 129 154 } 155 156 $network = $node->getNetwork(); 130 157 } else { 131 158 // Gateway ID is not set ... virtual login 132 159 $network = Network::getCurrentNetwork(); 133 $node = null;160 $node = Node::getObject('default'); 134 161 } 135 162 … … 160 187 * Normal login process 161 188 */ 162 if (!empty($username) && !empty($password)) { 163 // Init values 164 $errmsg = ''; 165 // Authenticating the user through the selected auth source. 166 $network = Network::processSelectNetworkUI('auth_source'); 167 168 $user = $network->getAuthenticator()->login($username, $password, $errmsg); 169 170 if ($user != null) { 171 if (!empty($gw_address) && !empty($gw_port)) { 172 // Login from a gateway, redirect to the gateway to activate the token 173 $token = $user->generateConnectionToken(); 174 175 header("Location: http://" . $gw_address . ":" . $gw_port . "/wifidog/auth?token=" . $token); 176 } else { 177 // Virtual login, redirect to the auth server homepage 178 header("Location: " . BASE_SSL_PATH . ($continueToAdmin ? "admin/" : "")); 179 } 180 181 exit; 182 } else { 183 $error = $errmsg; 184 } 185 } else { 186 /* 187 * Note that this is executed even when we have just arrived at the login 188 * page, so the user is reminded to supply a username and password 189 */ 190 $error = _('Your must specify your username and password'); 189 if (isset ($_REQUEST["form_request"]) && $_REQUEST["form_request"] == "login") { 190 if (!empty($username) && !empty($password)) { 191 // Init values 192 $errmsg = ''; 193 // Authenticating the user through the selected auth source. 194 $network = Network::processSelectNetworkUI('auth_source'); 195 196 $user = $network->getAuthenticator()->login($username, $password, $errmsg); 197 198 if ($user != null) { 199 if (!empty($gw_address) && !empty($gw_port)) { 200 // Login from a gateway, redirect to the gateway to activate the token 201 $token = $user->generateConnectionToken(); 202 203 header("Location: http://" . $gw_address . ":" . $gw_port . "/wifidog/auth?token=" . $token); 204 } else { 205 // Virtual login, redirect to the auth server homepage 206 header("Location: " . BASE_SSL_PATH . ($continueToAdmin ? "admin/" : "")); 207 } 208 209 exit; 210 } else { 211 $error = $errmsg; 212 } 213 } 191 214 } 192 215 … … 204 227 */ 205 228 206 // Init ALL smarty values207 $smarty->assign('node', null);208 $smarty->assign('gwAddress', null);209 $smarty->assign('gwPort', null);210 $smarty->assign('gwId', null);211 $smarty->assign('origin', null);212 $smarty->assign('selectNetworkUI', null);213 $smarty->assign('username', null);214 $smarty->assign('error', null);215 216 229 /* 217 230 * Tool content … … 225 238 226 239 // Check if user wanted to enter the administration interface 227 if (!empty($_REQUEST['origin'])) { 228 $smarty->assign('origin', $_REQUEST['origin']); 229 } 240 $smarty->assign('origin', empty($_REQUEST['origin']) ? null : $_REQUEST['origin']); 230 241 231 242 // Set network selector … … 238 249 $smarty->assign('error', !empty($error) ? $error : null); 239 250 251 $smarty->assign('create_a_free_account', $create_a_free_account); 252 240 253 // Compile HTML code 241 254 $html = $smarty->fetch("templates/sites/login.tpl"); 242 255 243 244 245 246 256 $ui = new MainUI(); 247 if($node) 248 { 249 $ui->setTitle(sprintf(_("%s login page for %s"),$network->getName(), $node->getName())); 250 } 251 else 252 { 257 if($node) { 258 $ui->setTitle(sprintf(_("%s login page for %s"), $network->getName(), $node->getName())); 259 } else { 253 260 $ui->setTitle(_("Offsite login page")); 254 261 } 255 262 $ui->setPageName('login'); 263 $ui->shrinkLeftArea(); 256 264 $ui->appendContent('left_area_middle', $html); 265 257 266 /* 258 267 * Main content … … 290 299 } 291 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 292 320 /* 293 321 * Render output … … 302 330 * End: 303 331 */ 332 333 ?> -
trunk/wifidog-auth/wifidog/lost_password.php
r1009 r1018 72 72 $smarty->assign('SelectNetworkUI', ""); 73 73 74 if (isset($_REQUEST['submit'])) { 74 $smarty->assign('username', ""); 75 $smarty->assign('email', ""); 76 77 if (isset($_REQUEST['form_request'])) { 75 78 $account_origin = Network::getObject($_REQUEST['auth_source']); 76 79 -
trunk/wifidog-auth/wifidog/lost_username.php
r1009 r1018 72 72 $smarty->assign('SelectNetworkUI', ""); 73 73 74 if (isset($_REQUEST["submit"])) { 74 $smarty->assign('email', ""); 75 76 if (isset($_REQUEST["form_request"])) { 75 77 $account_origin = Network::getObject($_REQUEST['auth_source']); 76 78 -
trunk/wifidog-auth/wifidog/resend_validation.php
r1009 r1018 66 66 67 67 // Init ALL smarty values 68 $smarty->assign('username', ""); 68 69 $smarty->assign('message', ""); 69 70 $smarty->assign('error', ""); … … 72 73 $smarty->assign('SelectNetworkUI', ""); 73 74 74 if (isset($_REQUEST[" submit"])) {75 if (isset($_REQUEST["form_request"])) { 75 76 $account_origin = Network::getObject($_REQUEST['auth_source']); 76 77 -
trunk/wifidog-auth/wifidog/signup.php
r1009 r1018 161 161 $smarty->assign('SelectNetworkUI', ""); 162 162 163 if (isset ($_REQUEST[" submit"])) {163 if (isset ($_REQUEST["form_request"]) && $_REQUEST["form_request"] == "signup") { 164 164 // Secure entered values 165 165 $username = trim($_REQUEST['username']); … … 221 221 $created_user->sendValidationEmail(); 222 222 223 // Authenticate this new user automatically 224 $errmsg = ""; 225 $authenticated_user = $network->getAuthenticator()->login($username, $password, $errmsg); 226 227 // While in validation period, alert user that he should validate his account ASAP 228 $validationMsgHtml = "<div id='warning_message_area'>\n"; 229 $validationMsgHtml .= _("An email with confirmation instructions was sent to your email address."); 230 $validationMsgHtml .= sprintf(_("Your account has been granted %s minutes of access to retrieve your email and validate your account."), ($network->getValidationGraceTime() / 60)); 231 $validationMsgHtml .= _('You may now open a browser window or start your email client and go to any remote Internet address to obtain the validation email.'); 232 $validationMsgHtml .= "</div>\n"; 233 223 234 // If the user is at a REAL hotspot, give him his sign-up minutes right away 224 235 $gw_id = $session->get(SESS_GW_ID_VAR); … … 227 238 228 239 if ($gw_id && $gw_address && $gw_port) { 229 // Init values230 $errmsg = "";231 232 // Authenticate this new user automatically233 $authenticated_user = $network->getAuthenticator()->login($username, $password, $errmsg);234 235 240 // Make sure the user IDs match 236 241 if(($created_user->getId() == $authenticated_user->getId())) { 237 242 $token = $created_user->generateConnectionToken(); 238 243 239 header("Location: http://" . $gw_address . ":" . $gw_port . "/wifidog/auth?token=" . $token);244 $redirURL = "http://" . $gw_address . ":" . $gw_port . "/wifidog/auth?token=" . $token; 240 245 } else { 241 header("Location: " . BASE_NON_SSL_PATH);246 $redirURL = BASE_NON_SSL_PATH; 242 247 } 243 } else { 244 $smarty->assign('message', _('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. You may now open a browser window and go to any remote Internet address to obtain the login page.'));248 249 MainUI::redirect($redirURL, 0); 245 250 } 246 251 … … 252 257 */ 253 258 $ui = new MainUI(); 259 254 260 $ui->appendContent('left_area_middle', $html); 255 261 $ui->appendContent('main_area_middle', $html_body); 262 263 // $ui->appendContent('page_header', $validationMsgHtml); 264 $ui->appendContent('main_area_top', $validationMsgHtml); 265 256 266 $ui->display(); 257 267 … … 276 286 * Tool content 277 287 */ 288 289 if (isset ($_REQUEST["form_request"]) && $_REQUEST["form_request"] == "login") { 290 $username = trim($_REQUEST['username']); 291 if (strpos($username, "@") === false) 292 $smarty->assign('username', $username); 293 else { 294 $email = $username; 295 $username = ""; 296 $smarty->assign('email', $email); 297 } 298 } 278 299 279 300 // Set section of Smarty template -
trunk/wifidog-auth/wifidog/templates/change_password.html
r743 r1018 1 1 <fieldset class="pretty_fieldset"> 2 2 <legend>{"Change my password"|_}</legend> 3 4 <form name="form" method="post">5 <table>3 <form name="form" method="post" onsubmit="return false" action="{$base_ssl_path}change_password.php"> 4 <input type="hidden" name="form_request" value="change_password"> 5 <table> 6 6 {if $SelectNetworkUI} 7 7 {$SelectNetworkUI} 8 8 {/if} 9 <tr> 10 <td>{"Your username"|_}:</td> 11 <td><input type="text" name="username" value="{$username}" size="20"></td> 12 </tr> 13 <tr> 14 <td>{"Your current password"|_}:</td> 15 <td><input type="password" name="oldpassword" value="{$oldpassword}" size="20"></td> 16 </tr> 17 <tr> 18 <td>{"Your new password"|_}:</td> 19 <td><input type="password" name="newpassword" value="{$newpassword}" size="20"></td> 20 </tr> 21 <tr> 22 <td>{"Your new password"|_} {"(again)"|_}:</td> 23 <td><input type="password" name="newpassword_again" value="{$newpassword_again}" size="20"></td> 24 </tr> 25 <tr> 26 <td></td> 27 <td><input class="submit" type="submit" name="submit" value="{"Change my password"|_}"></td> 28 </tr> 29 </table> 30 </form> 31 9 <tr> 10 <td>{"Your username"|_}:</td> 11 <td><input type="text" name="username" value="{$username}" size="20" id="form_username" onkeypress="return focusNext(this.form, 'oldpassword', event)"{if !$isSuperAdmin} readonly{/if}></td> 12 </tr> 13 <tr> 14 <td>{"Your current password"|_}:</td> 15 <td><input type="password" name="oldpassword" value="{$oldpassword}" size="20" id="form_oldpassword" onkeypress="return focusNext(this.form, 'newpassword', event)"></td> 16 </tr> 17 <tr> 18 <td>{"Your new password"|_}:</td> 19 <td><input type="password" name="newpassword" value="{$newpassword}" size="20" onkeypress="return focusNext(this.form, 'newpassword_again', event)"></td> 20 </tr> 21 <tr> 22 <td>{"Your new password"|_} {"(again)"|_}:</td> 23 <td><input type="password" name="newpassword_again" value="{$newpassword_again}" size="20" onkeypress="return focusNext(this.form, 'form_submit', event)"></td> 24 </tr> 25 <tr> 26 <td></td> 27 <td><input class="submit" type="submit" name="form_submit" value="{"Change my password"|_}" onclick="if (validateForm(this.form)) this.form.submit()"></td> 28 </tr> 29 </table> 30 </form> 32 31 </fieldset> 33 32 34 <div id="help"> 35 {if $error} 36 {$error} 37 {else} 38 {"Please enter your current username, your current password, and your new password (with confirmation)"|_}. 39 {/if} 40 </div> 33 <div id="help"> 34 {"Please enter your current username, your current password, and your new password (with confirmation)"|_}. 35 </div> 36 37 <div id="form_errormsg" class="errormsg"> 38 {if $error} 39 {$error} 40 {/if} 41 </div> 42 43 <script type="text/javascript"> 44 <!-- 45 {literal} 46 var messages = { 47 {/literal} 48 empty_form: "{"You must specify your username and password"|_}", 49 username_required: "{'Username is required.'|_}", 50 username_invalid: "{'Username contains invalid characters.'|_}", 51 password_empty: "{'A password of at least 6 characters is required.'|_}", 52 password_invalid: "{'Password contains invalid characters.'|_}", 53 password_short: "{'Password is too short, it must be 6 characters minimum'|_}", 54 password_twice: "{'You must type your password twice.'|_}", 55 password_match: "{'Passwords do not match.'|_}" 56 {literal} 57 }; 58 59 {/literal} 60 {if $isSuperAdmin} 61 document.getElementById("form_username").focus(); 62 {else} 63 document.getElementById("form_oldpassword").focus(); 64 {/if} 65 {literal} 66 67 function validateForm(form) { 68 if (!isValidUsername(form.username)) { 69 if (isEmpty(form.username)) 70 document.getElementById("form_errormsg").innerHTML = messages.username_required; 71 else 72 document.getElementById("form_errormsg").innerHTML = messages.username_invalid; 73 74 focusElement(form.name, 'username'); 75 76 return false; 77 } 78 79 if (!isValidPassword(form.oldpassword)) { 80 if (isEmpty(form.oldpassword)) 81 document.getElementById("form_errormsg").innerHTML = messages.password_empty; 82 else if (form.oldpassword.value.length<6) 83 document.getElementById("form_errormsg").innerHTML = messages.password_short; 84 else 85 document.getElementById("form_errormsg").innerHTML = messages.password_invalid; 86 87 focusElement(form.name, 'oldpassword'); 88 89 return false; 90 } 91 92 if (!isValidPassword(form.newpassword)) { 93 if (isEmpty(form.newpassword)) 94 document.getElementById("form_errormsg").innerHTML = messages.password_empty; 95 else if (form.newpassword.value.length<6) 96 document.getElementById("form_errormsg").innerHTML = messages.password_short; 97 else 98 document.getElementById("form_errormsg").innerHTML = messages.password_invalid; 99 100 focusElement(form.name, 'newpassword'); 101 102 return false; 103 } 104 105 if (isEmpty(form.newpassword_again)) { 106 document.getElementById("form_errormsg").innerHTML = messages.password_twice; 107 focusElement(form.name, 'newpassword_again'); 108 return false; 109 } 110 111 if (form.newpassword.value != form.newpassword_again.value) { 112 document.getElementById("form_errormsg").innerHTML = messages.password_match; 113 focusElement(form.name, 'newpassword_again'); 114 return false; 115 } 116 117 return true; 118 } 119 120 {/literal} 121 //--> 122 </script> -
trunk/wifidog-auth/wifidog/templates/classes/MainUI_Display.tpl
r1012 r1018 60 60 61 61 <link rel="stylesheet" type="text/css" href="{$stylesheetURL}"> 62 <script src="{$system_path}js/formutils.js"></script> 62 63 63 64 <style type="text/css"> … … 71 72 {if $debugRequested} 72 73 <pre>{$debugOutput}</pre> 74 {/if} 75 {if !empty($contentArray.page_header)} 76 {$contentArray.page_header} 73 77 {/if} 74 78 </div> -
trunk/wifidog-auth/wifidog/templates/classes/MainUI_ToolContent.tpl
r1009 r1018 55 55 {if $isValidUser} 56 56 <p>{"Logged in as"|_}: {$username}</p> 57 <a class="administration" href="{$ base_ssl_path}user_profile.php"><img class="administration" src="{$base_ssl_path}images/profile.gif" border="0">{"My Profile"|_}</a>58 <a class="administration" href="{$ base_ssl_path}login/?logout=true{$logoutParameters}"><img class="administration" src="{$base_ssl_path}images/logout.gif" border="0">{"Logout"|_}</a>57 <a class="administration" href="{$system_path}user_profile.php"><img class="administration" src="{$system_path}images/profile.gif">{"My Profile"|_}</a> 58 <a class="administration" href="{$system_path}login/?logout=true{$logoutParameters}"><img class="administration" src="{$system_path}images/logout.gif">{"Logout"|_}</a> 59 59 {else} 60 {if !$shrinkLeftArea} 60 61 <p> 61 62 {"I am not logged in."|_}<br> 62 <a href="{$ base_ssl_path}login/{$loginParameters}">{"Login"|_}</a>63 <a href="{$system_path}login/{$loginParameters}">{"Login"|_}</a> 63 64 </p> 65 {/if} 64 66 65 <a class="administration" href="{$networkHomepageURL}"><img class="administration" src="{$ base_url_path}images/lien_ext.gif">{$networkName}</a>66 <a class="administration" href="{$ base_ssl_path}faq.php"><img class="administration" src="{$base_url_path}images/where.gif">{"Where am I?"|_}</a>67 <a class="administration" href="{$networkHomepageURL}"><img class="administration" src="{$system_path}images/lien_ext.gif">{$networkName}</a> 68 <a class="administration" href="{$system_path}faq.php"><img class="administration" src="{$system_path}images/where.gif">{"Where am I?"|_}</a> 67 69 {/if} 68 70 </span> … … 88 90 </div> 89 91 92 {if !$shrinkLeftArea} 90 93 <div class="avis"> 91 94 <span class="avis"> … … 94 97 </span> 95 98 </div> 99 {/if} 96 100 {* 97 101 END section START -
trunk/wifidog-auth/wifidog/templates/classes/MainUI_ToolSection.tpl
r974 r1018 57 57 <div class="admin_section_data"> 58 58 <ul> 59 <li><a href="{$ base_ssl_path}admin/user_log.php">{"User logs"|_}</a></li>60 <li><a href="{$ base_ssl_path}admin/online_users.php">{"Online Users"|_}</a></li>61 <li><a href="{$ base_ssl_path}admin/stats.php">{"Statistics"|_}</a></li>62 <li><a href="{$ base_ssl_path}admin/import_user_database.php">{"Import NoCat user database"|_}</a></li>59 <li><a href="{$system_path}admin/user_log.php">{"User logs"|_}</a></li> 60 <li><a href="{$system_path}admin/online_users.php">{"Online Users"|_}</a></li> 61 <li><a href="{$system_path}admin/stats.php">{"Statistics"|_}</a></li> 62 <li><a href="{$system_path}admin/import_user_database.php">{"Import NoCat user database"|_}</a></li> 63 63 </ul> 64 64 </div> … … 87 87 <div class="admin_section_data"> 88 88 <ul> 89 <li><a href="{$ base_ssl_path}admin/generic_object_admin.php?object_class=Node&action=list">{"Nodes"|_}</a></li>90 <li><a href="{$ base_ssl_path}admin/generic_object_admin.php?object_class=Node&action=new_ui">{"Add new Node"|_}</a></li>89 <li><a href="{$system_path}admin/generic_object_admin.php?object_class=Node&action=list">{"Nodes"|_}</a></li> 90 <li><a href="{$system_path}admin/generic_object_admin.php?object_class=Node&action=new_ui">{"Add new Node"|_}</a></li> 91 91 </ul> 92 92 </div> … … 100 100 <div class="admin_section_data"> 101 101 <ul> 102 <li><a href="{$ base_ssl_path}admin/generic_object_admin.php?object_class=Network&action=list">{"Networks"|_}</a></li>102 <li><a href="{$system_path}admin/generic_object_admin.php?object_class=Network&action=list">{"Networks"|_}</a></li> 103 103 </ul> 104 104 </div> … … 110 110 <div class="admin_section_data"> 111 111 <ul> 112 <li><a href="{$ base_ssl_path}admin/generic_object_admin.php?object_class=Server&action=list">{"Servers"|_}</a></li>113 <li><a href="{$ base_ssl_path}admin/generic_object_admin.php?object_class=Content&action=list">{"Content"|_}</a></li>112 <li><a href="{$system_path}admin/generic_object_admin.php?object_class=Server&action=list">{"Servers"|_}</a></li> 113 <li><a href="{$system_path}admin/generic_object_admin.php?object_class=Content&action=list">{"Content"|_}</a></li> 114 114 </ul> 115 115 </div> -
trunk/wifidog-auth/wifidog/templates/sites/index.tpl
r1005 r1018 53 53 <div id="login_form"> 54 54 <ul> 55 <li><a href="{$base_ssl_path}change_password.php">{"Change password"|_}</a></li> 56 <li><a href="{$base_ssl_path}faq.php">{"I have trouble connecting and I would like some help"|_}</a></li> 55 {if $isValidUser} 56 <li><a href="{$system_path}change_password.php">{"Change password"|_}</a></li> 57 {else} 58 <li><a href="{$system_path}faq.php">{"I have trouble connecting and I would like some help"|_}</a></li> 59 {/if} 57 60 </ul> 58 61 </div> … … 99 102 <ul> 100 103 {if $googleMapsEnabled && !$userIsAtHotspot} 101 <li><a href="{$ base_non_ssl_path}hotspots_map.php">{"Deployed HotSpots map"|_}</a></li>104 <li><a href="{$system_path}hotspots_map.php">{"Deployed HotSpots map"|_}</a></li> 102 105 {/if} 103 <li><a href="{$ base_ssl_path}hotspot_status.php">{"Deployed HotSpots status with coordinates"|_}</a></li>104 <li><a href="{$ base_ssl_path}node_list.php">{"Full node technical status (includes non-deployed nodes)"|_}</a></li>105 <li><a href="{$ base_ssl_path}admin/index.php">{"Administration"|_}</a></li>106 <li><a href="{$system_path}hotspot_status.php">{"Deployed HotSpots status with coordinates"|_}</a></li> 107 <li><a href="{$system_path}node_list.php">{"Full node technical status (includes non-deployed nodes)"|_}</a></li> 108 <li><a href="{$system_path}admin/index.php">{"Administration"|_}</a></li> 106 109 </ul> 107 110 {* -
trunk/wifidog-auth/wifidog/templates/sites/login.tpl
r1009 r1018 48 48 49 49 <div id="login_form"> 50 <h1><a href="{$base_ssl_path}signup.php">{"Create a free account"|_}</a></h1> 51 52 <h1>{"I already have an account"|_}:</h1> 50 <h1>{"Login or Signup here"|_}:</h1> 53 51 54 52 <p class="indent"> 55 <form name="login_form" method="post"> 53 <form name="login_form" method="post" onsubmit="return false" action="{$base_ssl_path}login/index.php"> 54 <input type="hidden" name="form_request" value="login"> 56 55 {if $node != null} 57 56 <input type="hidden" name="gw_address" value="{$gw_address}"> … … 66 65 67 66 {"Username (or email)"|_}:<br> 68 <input type="text" name="username" value="{$username}" size="20" id="form_username" ><br>67 <input type="text" name="username" value="{$username}" size="20" id="form_username" onkeypress="return focusNext(this.form, 'password', event)"><br> 69 68 {"Password"|_}:<br> 70 <input type="password" name="password" size="20" ><br>69 <input type="password" name="password" size="20" id="form_password" onkeypress="return focusNext(this.form, 'form_submit', event)"><br> 71 70 72 {if $error != null} 73 <div class="errormsg">{$error}</div> 74 {/if} 71 <div id="form_errormsg" class="errormsg"> 72 {if $error == null} 73 74 {else} 75 {$error} 76 {/if} 77 </div> 75 78 76 <input class="submit" type="submit" name="submit" value="{"Login"|_}"> 79 <input class="submit" type="button" name="form_submit" value="{"Login"|_}" onclick="if (validateForm(this.form)) this.form.submit()"> 80 81 <input class="submit" type="button" name="form_signup" value="{$create_a_free_account}" onclick="this.form.action='{$base_ssl_path}signup.php'; this.form.submit()"> 77 82 </form> 78 83 </p> 84 85 <div id="help"> 86 {"You must specify your username and password"|_}. 87 </div> 79 88 80 89 <h1>{"I'm having difficulties"|_}:</h1> 81 90 82 91 <ul> 83 <li><a href="{$ base_ssl_path}lost_username.php">{"I Forgot my username"|_}</a></li>84 <li><a href="{$ base_ssl_path}lost_password.php">{"I Forgot my password"|_}</a></li>85 <li><a href="{$ base_ssl_path}resend_validation.php">{"Re-send the validation email"|_}</a></li>86 <li><a href="{$ base_ssl_path}faq.php">{"Frequently asked questions"|_}</a></li>92 <li><a href="{$system_path}lost_username.php">{"I Forgot my username"|_}</a></li> 93 <li><a href="{$system_path}lost_password.php">{"I Forgot my password"|_}</a></li> 94 <li><a href="{$system_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> 95 <li><a href="{$system_path}faq.php">{"Frequently asked questions"|_}</a></li> 87 96 </ul> 88 97 </div> … … 90 99 <script type="text/javascript"> 91 100 <!-- 92 document.getElementById("form_username").focus(); 101 {literal} 102 var messages = { 103 {/literal} 104 empty_form: "{"You must specify your username and password"|_}", 105 username_required: "{'Username is required.'|_}", 106 username_invalid: "{'Username contains invalid characters.'|_}", 107 email_invalid: "{'A valid email address is required.'|_}", 108 password_empty: "{'A password of at least 6 characters is required.'|_}", 109 password_invalid: "{'Password contains invalid characters.'|_}", 110 password_short: "{'Password is too short, it must be 6 characters minimum'|_}" 111 {literal} 112 }; 113 114 document.getElementById("form_username").focus(); 115 116 function validateForm(form) { 117 if (!isValidUsername(form.username)) { 118 if (isEmpty(form.username)) { 119 document.getElementById("form_errormsg").innerHTML = messages.username_required; 120 return false; 121 } 122 else { 123 if (!isValidEmail(form.username)) { 124 document.getElementById("form_errormsg").innerHTML = messages.username_invalid; 125 return false; 126 } 127 } 128 } 129 130 if (!isValidPassword(form.password)) { 131 if (isEmpty(form.password)) 132 document.getElementById("form_errormsg").innerHTML = messages.password_empty; 133 else if (form.password.value.length<6) 134 document.getElementById("form_errormsg").innerHTML = messages.password_short; 135 else 136 document.getElementById("form_errormsg").innerHTML = messages.password_invalid; 137 138 return false; 139 } 140 141 return true; 142 } 143 144 {/literal} 93 145 //--> 94 146 </script> -
trunk/wifidog-auth/wifidog/templates/sites/lost_password.tpl
r959 r1018 59 59 60 60 <ul> 61 <li><a href="{$ base_ssl_path}lost_username.php">{"I Forgot my username"|_}</a></li>62 <li><a href="{$ base_ssl_path}lost_password.php">{"I Forgot my password"|_}</a></li>63 <li><a href="{$ base_ssl_path}resend_validation.php">{"Re-send the validation email"|_}</a></li>64 <li><a href="{$ base_ssl_path}faq.php">{"Frequently asked questions"|_}</a></li>61 <li><a href="{$system_path}lost_username.php">{"I Forgot my username"|_}</a></li> 62 <li><a href="{$system_path}lost_password.php">{"I Forgot my password"|_}</a></li> 63 <li><a href="{$system_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> 64 <li><a href="{$system_path}faq.php">{"Frequently asked questions"|_}</a></li> 65 65 </ul> 66 66 </div> … … 77 77 <legend>{"Lost password"|_}</legend> 78 78 79 <form name="form" method="post"> 79 <form name="form" method="post" onsubmit="return false" action="{$base_ssl_path}lost_password.php"> 80 <input type="hidden" name="form_request" value="lost_password"> 80 81 {if $SelectNetworkUI} 81 82 {$SelectNetworkUI} … … 85 86 <tr> 86 87 <th>{"Your username"|_}:</th> 87 <td><input type="text" name="username" value="{$username}" size="20" id="form_username" ></td>88 <td><input type="text" name="username" value="{$username}" size="20" id="form_username" onkeypress="return focusNext(this.form, 'email', event)"></td> 88 89 </tr> 89 90 <tr> 90 91 <th>{"Your email address"|_}:</th> 91 <td><input type="text" name="email" value="{$email}" size="20" ></td>92 <td><input type="text" name="email" value="{$email}" size="20" onkeypress="return focusNext(this.form, 'form_submit', event)"></td> 92 93 </tr> 93 94 <tr> 94 95 <th></th> 95 <td><input class="submit" type="submit" name=" submit" value="{"Reset my password"|_}"></td>96 <td><input class="submit" type="submit" name="form_submit" value="{"Reset my password"|_}" onclick="if (validateForm(this.form)) this.form.submit()"></td> 96 97 </tr> 97 98 </table> … … 100 101 101 102 <div id="help"> 102 {if $error} 103 <div class="errormsg">{$error}</div> 104 {else} 105 {"Please enter your username or email address to reset your password"|_}. 106 {/if} 103 {"Please enter your username or email address to reset your password"|_}. 107 104 </div> 108 105 106 <div id="form_errormsg" class="errormsg"> 107 {if $error} 108 {$error} 109 {/if} 110 </div> 111 109 112 <script type="text/javascript"> 110 <!-- 111 document.getElementById("form_username").focus(); 112 //--> 113 <!-- 114 {literal} 115 var messages = { 116 {/literal} 117 username_required: "{'Please specify a username or email address'|_}", 118 username_invalid: "{'Username contains invalid characters.'|_}", 119 email_invalid: "{'The email address must be valid (i.e. user@domain.com). Please understand that we also black-listed various temporary-email-address providers.'|_}" 120 {literal} 121 }; 122 123 document.getElementById("form_username").focus(); 124 125 function validateForm(form) { 126 if (!isValidUsername(form.username)) { 127 if (isEmpty(form.username)) { 128 if (isEmpty(form.email)) { 129 // username and email cannot both be empty 130 document.getElementById("form_errormsg").innerHTML = messages.username_required; 131 return false; 132 } 133 } 134 else { 135 document.getElementById("form_errormsg").innerHTML = messages.username_invalid; 136 return false; 137 } 138 } 139 140 if (!isValidEmail(form.email)) { 141 if (isNotEmpty(form.email)) { 142 document.getElementById("form_errormsg").innerHTML = messages.email_invalid; 143 return false; 144 } 145 else if (isEmpty(form.username)) { 146 // username and email cannot both be empty 147 document.getElementById("form_errormsg").innerHTML = messages.username_required; 148 return false; 149 } 150 } 151 152 return true; 153 } 154 155 {/literal} 156 //--> 113 157 </script> 114 158 {* -
trunk/wifidog-auth/wifidog/templates/sites/lost_username.tpl
r958 r1018 59 59 60 60 <ul> 61 <li><a href="{$ base_ssl_path}lost_username.php">{"I Forgot my username"|_}</a></li>62 <li><a href="{$ base_ssl_path}lost_password.php">{"I Forgot my password"|_}</a></li>63 <li><a href="{$ base_ssl_path}resend_validation.php">{"Re-send the validation email"|_}</a></li>64 <li><a href="{$ base_ssl_path}faq.php">{"Frequently asked questions"|_}</a></li>61 <li><a href="{$system_path}lost_username.php">{"I Forgot my username"|_}</a></li> 62 <li><a href="{$system_path}lost_password.php">{"I Forgot my password"|_}</a></li> 63 <li><a href="{$system_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> 64 <li><a href="{$system_path}faq.php">{"Frequently asked questions"|_}</a></li> 65 65 </ul> 66 66 </div> … … 77 77 <legend>{"Lost username"|_}</legend> 78 78 79 <form name="form" method="post"> 79 <form name="form" method="post" onsubmit="return false" action="{$base_ssl_path}lost_username.php"> 80 <input type="hidden" name="form_request" value="lost_username"> 80 81 {if $SelectNetworkUI} 81 82 {$SelectNetworkUI} … … 85 86 <tr> 86 87 <th>{"Your email address"|_}:</th> 87 <td><input type="text" name="email" value="{$email}" size="20" id="form_email" ></td>88 <td><input type="text" name="email" value="{$email}" size="20" id="form_email" onkeypress="return focusNext(this.form, 'form_submit', event)"></td> 88 89 </tr> 89 90 <tr> 90 91 <th></th> 91 <td><input class="submit" type="submit" name=" submit" value="{"Retrieve"|_}"></td>92 <td><input class="submit" type="submit" name="form_submit" value="{"Retrieve"|_}" onclick="if (validateForm(this.form)) this.form.submit()"></td> 92 93 </tr> 93 94 </table> … … 96 97 97 98 <div id="help"> 98 {if $error} 99 <div class="errormsg">{$error}</div> 100 {else} 101 {"Please enter your email address to recover your username"|_}. 102 {/if} 99 {"Please enter your email address to recover your username"|_}. 103 100 </div> 104 101 102 <div id="form_errormsg" class="errormsg"> 103 {if $error} 104 {$error} 105 {/if} 106 </div> 107 105 108 <script type="text/javascript"> 106 <!-- 107 document.getElementById("form_email").focus(); 108 //--> 109 <!-- 110 {literal} 111 var messages = { 112 {/literal} 113 email_required: "{'Please specify an email address.'|_}", 114 email_invalid: "{'The email address must be valid (i.e. user@domain.com). Please understand that we also black-listed various temporary-email-address providers.'|_}", 115 {literal} 116 }; 117 118 document.getElementById("form_email").focus(); 119 120 function validateForm(form) { 121 if (!isValidEmail(form.email)) { 122 if (isEmpty(form.email)) 123 document.getElementById("form_errormsg").innerHTML = messages.email_required; 124 else 125 document.getElementById("form_errormsg").innerHTML = messages.email_invalid; 126 return false; 127 } 128 129 return true; 130 } 131 {/literal} 132 //--> 109 133 </script> 110 134 {* -
trunk/wifidog-auth/wifidog/templates/sites/resend_validation.tpl
r962 r1018 59 59 60 60 <ul> 61 <li><a href="{$ base_ssl_path}lost_username.php">{"I Forgot my username"|_}</a></li>62 <li><a href="{$ base_ssl_path}lost_password.php">{"I Forgot my password"|_}</a></li>63 <li><a href="{$ base_ssl_path}resend_validation.php">{"Re-send the validation email"|_}</a></li>64 <li><a href="{$ base_ssl_path}faq.php">{"Frequently asked questions"|_}</a></li>61 <li><a href="{$system_path}lost_username.php">{"I Forgot my username"|_}</a></li> 62 <li><a href="{$system_path}lost_password.php">{"I Forgot my password"|_}</a></li> 63 <li><a href="{$system_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> 64 <li><a href="{$system_path}faq.php">{"Frequently asked questions"|_}</a></li> 65 65 </ul> 66 66 </div> … … 77 77 <legend>{"Re-send validation email"|_}</legend> 78 78 79 <form name="form"> 79 <form name="form" method="post" onsubmit="return false" action="{$base_ssl_path}resend_validation.php"> 80 <input type="hidden" name="form_request" value="resend_validation"> 80 81 {if $SelectNetworkUI} 81 82 {$SelectNetworkUI} … … 85 86 <tr> 86 87 <th>{"Your username"|_}:</th> 87 <td><input type="text" name="username" value="{$username}" size="20" id="form_username" ></td>88 <td><input type="text" name="username" value="{$username}" size="20" id="form_username" onkeypress="return focusNext(this.form, 'form_submit', event)"></td> 88 89 </tr> 89 90 <tr> 90 91 <th></th> 91 <td><input class="submit" type="submit" name=" submit" value="{"Re-send"|_}"></td>92 <td><input class="submit" type="submit" name="form_submit" value="{"Re-send"|_}" onclick="if (validateForm(this.form)) this.form.submit()"></td> 92 93 </tr> 93 94 </table> … … 96 97 97 98 <div id="help"> 98 {if $error} 99 <div class="errormsg">{$error}</div> 100 {else} 101 {"Please enter your username and the validation email will be resent to your email address"|_}. 102 {/if} 99 {"Please enter your username and the validation email will be resent to your email address"|_}. 103 100 </div> 104 101 102 <div id="form_errormsg" class="errormsg"> 103 {if $error} 104 {$error} 105 {/if} 106 </div> 107 105 108 <script type="text/javascript"> 106 <!-- 107 document.getElementById("form_username").focus(); 108 //--> 109 <!-- 110 {literal} 111 var messages = { 112 {/literal} 113 username_required: "{'Username is required.'|_}", 114 username_invalid: "{'Username contains invalid characters.'|_}", 115 {literal} 116 }; 117 118 document.getElementById("form_username").focus(); 119 120 function validateForm(form) { 121 if (!isValidUsername(form.username)) { 122 if (isEmpty(form.username)) 123 document.getElementById("form_errormsg").innerHTML = messages.username_required; 124 else 125 document.getElementById("form_errormsg").innerHTML = messages.username_invalid; 126 127 return false; 128 } 129 130 return true; 131 } 132 {/literal} 133 //--> 109 134 </script> 110 135 {* -
trunk/wifidog-auth/wifidog/templates/sites/signup.tpl
r955 r1018 35 35 36 36 /** 37 * Sign up page38 *39 * @package WiFiDogAuthServer40 * @subpackage Templates41 * @author Philippe April42 * @author Benoit Gregoire <bock@step.polymtl.ca>43 * @author Max Horvath <max.horvath@maxspot.de>44 * @copyright 2004-2006 Philippe April45 * @copyright 2004-2006 Benoit Gregoire, Technologies Coeus inc.46 * @copyright 2006 Max Horvath, maxspot GmbH47 * @version Subversion $Id$48 * @link http://www.wifidog.org/49 */37 * Sign up page 38 * 39 * @package WiFiDogAuthServer 40 * @subpackage Templates 41 * @author Philippe April 42 * @author Benoit Gregoire <bock@step.polymtl.ca> 43 * @author Max Horvath <max.horvath@maxspot.de> 44 * @copyright 2004-2006 Philippe April 45 * @copyright 2004-2006 Benoit Gregoire, Technologies Coeus inc. 46 * @copyright 2006 Max Horvath, maxspot GmbH 47 * @version Subversion $Id$ 48 * @link http://www.wifidog.org/ 49 */ 50 50 51 51 *} … … 53 53 {if $sectionTOOLCONTENT} 54 54 {* 55 BEGIN section TOOLCONTENT 56 *} 57 <div id="login_form"> 58 <h1>{"I'm having difficulties"|_}:</h1> 59 55 BEGIN section TOOLCONTENT 56 *} 57 <div id="login_form"> 58 <h1>{"I'm having difficulties"|_}:</h1> 59 60 <ul> 61 <li><a href="{$system_path}lost_username.php">{"I Forgot my username"|_}</a></li> 62 <li><a href="{$system_path}lost_password.php">{"I Forgot my password"|_}</a></li> 63 <li><a href="{$system_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> 64 <li><a href="{$system_path}faq.php">{"Frequently asked questions"|_}</a></li> 65 </ul> 66 </div> 67 {* 68 END section TOOLCONTENT 69 *} 70 {/if} 71 72 {if $sectionMAINCONTENT} 73 {* 74 BEGIN section MAINCONTENT 75 *} 76 <fieldset class="pretty_fieldset"> 77 <legend>{"Register a free account with"|_} {$hotspot_network_name}</legend> 78 79 <form name="signup_form" method="post" onsubmit="return false" action="{$base_ssl_path}signup.php"> 80 <input type="hidden" name="form_request" value="signup"> 81 {if $SelectNetworkUI} 82 {$SelectNetworkUI} 83 {/if} 84 85 <table> 86 <tr> 87 <th>{"Username desired"|_}:</th> 88 <td><input type="text" name="username" value="{$username}" size="30" id="form_username" onkeypress="return focusNext(this.form, 'email', event)"></td> 89 </tr> 90 <tr> 91 <th>{"Your email address"|_}:</th> 92 <td><input type="text" name="email" value="{$email}" size="30" onkeypress="return focusNext(this.form, 'password', event)"></td> 93 </tr> 94 <tr> 95 <th>{"Password"|_}:</th> 96 <td><input type="password" name="password" size="30" onkeypress="return focusNext(this.form, 'password_again', event)"></td> 97 </tr> 98 <tr> 99 <th>{"Password (again)"|_}:</th> 100 <td><input type="password" name="password_again" size="30" onkeypress="return focusNext(this.form, 'form_submit', event)"></td> 101 </tr> 102 <tr> 103 <th></th> 104 <td><input class="submit" type="submit" name="form_submit" value="{"Sign-up"|_}" onclick="if (validateForm(this.form)) this.form.submit()"></td> 105 </tr> 106 </table> 107 </form> 108 109 <hr> 110 111 <p> 112 <b>{"Please note"|_}</b>: 113 {"While accounts are free, we <em>strongly</em> suggest that you use your previously created account if you have one."|_} 114 </p> 115 116 <p> 117 {"<b>Your email address must be valid</b> in order for your account to be activated."|_} 118 {"A validation email will be sent to that email address."|_} 119 {"To fully activate your account you must respond to that email."|_} 120 </p> 121 122 <p> 123 <b>{"Note to free web-based email users"|_}</b>: 124 {"Sometimes our validation email ends up in the 'spam' folder of some providers. If you have not received any email with the validation URL 5 minutes after submitting this form, please take a look in the spam folder."|_} 125 </p> 126 127 <p> 128 <b>{"You can also use the following links if you need help"|_}:</b> 60 129 <ul> 61 <li><a href="{$base_ssl_path}lost_username.php">{"I Forgot my username"|_}</a></li> 62 <li><a href="{$base_ssl_path}lost_password.php">{"I Forgot my password"|_}</a></li> 63 <li><a href="{$base_ssl_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> 64 <li><a href="{$base_ssl_path}faq.php">{"Frequently asked questions"|_}</a></li> 130 <li><a href="{$system_path}lost_username.php">{"I Forgot my username"|_}</a></li> 131 <li><a href="{$system_path}lost_password.php">{"I Forgot my password"|_}</a></li> 65 132 </ul> 66 </div> 67 {* 68 END section TOOLCONTENT 69 *} 70 {/if} 71 72 {if $sectionMAINCONTENT} 73 {* 74 BEGIN section MAINCONTENT 75 *} 76 <fieldset class="pretty_fieldset"> 77 <legend>{"Register a free account with"|_} {$hotspot_network_name}</legend> 78 79 <form name="signup_form" method="post"> 80 {if $SelectNetworkUI} 81 {$SelectNetworkUI} 82 {/if} 83 84 <table> 85 <tr> 86 <th>{"Username desired"|_}:</th> 87 <td><input type="text" name="username" value="{$username}" size="30" id="form_username"></td> 88 </tr> 89 <tr> 90 <th>{"Your email address"|_}:</th> 91 <td><input type="text" name="email" value="{$email}" size="30"></td> 92 </tr> 93 <tr> 94 <th>{"Password"|_}:</th> 95 <td><input type="password" name="password" size="30"></td> 96 </tr> 97 <tr> 98 <th>{"Password (again)"|_}:</th> 99 <td><input type="password" name="password_again" size="30"></td> 100 </tr> 101 <tr> 102 <th></th> 103 <td><input class="submit" type="submit" name="submit" value="{"Sign-up"|_}"></td> 104 </tr> 105 </table> 106 </form> 107 108 <hr> 109 110 <p> 111 <b>{"Please note"|_}</b>: 112 {"While accounts are free, we <em>strongly</em> suggest that you use your previously created account if you have one."|_} 113 </p> 114 115 <p> 116 <b>{"Note to free web-based email users"|_}</b>: 117 {"Sometimes our validation email ends up in the 'spam' folder of some providers. If you have not received any email with the validation URL 5 minutes after submitting this form, please take a look in the spam folder."|_} 118 </p> 119 120 <p> 121 <b>{"You can also use the following links if you need help"|_}:</b> 122 <ul> 123 <li><a href="{$smarty.const.BASE_SSL_PATH}lost_username.php">{"I Forgot my username"|_}</a></li> 124 <li><a href="{$smarty.const.BASE_SSL_PATH}lost_password.php">{"I Forgot my password"|_}</a></li> 125 </ul> 126 </p> 127 </fieldset> 128 129 <div id="help"> 130 {if $error} 131 <div class="errormsg">{$error}</div> 132 {else} 133 {"Your email address must be valid in order for your account to be activated"|_}. 133 </p> 134 </fieldset> 135 136 <div id="form_errormsg" class="errormsg"> 137 {if $error != null} 138 {$error} 134 139 {/if} 135 </div>140 </div> 136 141 137 142 <script type="text/javascript"> 138 143 <!-- 139 document.getElementById("form_username").focus(); 144 {literal} 145 var messages = { 146 {/literal} 147 username_required: "{'Username is required.'|_}", 148 username_invalid: "{'Username contains invalid characters.'|_}", 149 email_invalid: "{'The email address must be valid (i.e. user@domain.com). Please understand that we also black-listed various temporary-email-address providers.'|_}", 150 password_empty: "{'A password of at least 6 characters is required.'|_}", 151 password_invalid: "{'Password contains invalid characters.'|_}", 152 password_twice: "{'You must type your password twice.'|_}", 153 password_match: "{'Passwords do not match.'|_}", 154 password_short: "{'Password is too short, it must be 6 characters minimum'|_}" 155 {literal} 156 }; 157 158 document.getElementById("form_username").focus(); 159 160 function validateForm(form) { 161 if (!isValidUsername(form.username)) { 162 if (isEmpty(form.username)) 163 document.getElementById("form_errormsg").innerHTML = messages.username_required; 164 else 165 document.getElementById("form_errormsg").innerHTML = messages.username_invalid; 166 167 return false; 168 } 169 170 if (!isValidEmail(form.email)) { 171 document.getElementById("form_errormsg").innerHTML = messages.email_invalid; 172 return false; 173 } 174 175 if (!isValidPassword(form.password)) { 176 if (isEmpty(form.password)) 177 document.getElementById("form_errormsg").innerHTML = messages.password_empty; 178 else if (form.password.value.length<6) 179 document.getElementById("form_errormsg").innerHTML = messages.password_short; 180 else 181 document.getElementById("form_errormsg").innerHTML = messages.password_invalid; 182 183 return false; 184 } 185 186 if (isEmpty(form.password_again)) { 187 document.getElementById("form_errormsg").innerHTML = messages.password_twice; 188 focusElement(form.name, 'password_again'); 189 return false; 190 } 191 192 if (form.password.value != form.password_again.value) { 193 document.getElementById("form_errormsg").innerHTML = messages.password_match; 194 focusElement(form.name, 'password_again'); 195 return false; 196 } 197 198 return true; 199 } 200 201 {/literal} 140 202 //--> 141 203 </script>
