Changeset 566
- Timestamp:
- 04/25/05 09:16:07 (8 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 1 added
- 7 removed
- 47 modified
-
ChangeLog (modified) (1 diff)
-
wifidog/admin/content_admin.php (modified) (2 diffs)
-
wifidog/admin/index.php (modified) (1 diff)
-
wifidog/admin/templates/hotspot_display.html (modified) (2 diffs)
-
wifidog/admin/templates/hotspot_edit.html (modified) (2 diffs)
-
wifidog/admin/templates/hotspot_log.html (modified) (2 diffs)
-
wifidog/admin/templates/hotspot_owner.html (modified) (2 diffs)
-
wifidog/admin/templates/online_users.html (modified) (2 diffs)
-
wifidog/admin/templates/owner_display.html (modified) (2 diffs)
-
wifidog/admin/templates/owner_upload.html (modified) (2 diffs)
-
wifidog/admin/templates/user_log.html (modified) (2 diffs)
-
wifidog/admin/templates/user_log_detailed.html (modified) (2 diffs)
-
wifidog/admin/templates/user_stats.html (modified) (2 diffs)
-
wifidog/admin/user_log.php (modified) (2 diffs)
-
wifidog/admin/user_stats.php (modified) (1 diff)
-
wifidog/classes/Content.php (modified) (2 diffs)
-
wifidog/classes/Locale.php (modified) (9 diffs)
-
wifidog/classes/LocaleList.php (modified) (2 diffs)
-
wifidog/classes/MainUI.php (added)
-
wifidog/classes/Network.php (modified) (3 diffs)
-
wifidog/classes/Node.php (modified) (4 diffs)
-
wifidog/classes/SmartyWifidog.php (modified) (1 diff)
-
wifidog/classes/User.php (modified) (1 diff)
-
wifidog/config.php (modified) (4 diffs)
-
wifidog/hotspot_status.php (modified) (1 diff)
-
wifidog/include/common.php (modified) (1 diff)
-
wifidog/include/language.php (modified) (1 diff)
-
wifidog/index.php (modified) (3 diffs)
-
wifidog/local_content/default/stylesheet.css (modified) (3 diffs)
-
wifidog/login/index.php (modified) (4 diffs)
-
wifidog/node_list.php (modified) (1 diff)
-
wifidog/portal/index.php (modified) (5 diffs)
-
wifidog/templates/auth_sources_selection.html (deleted)
-
wifidog/templates/change_password.html (modified) (2 diffs)
-
wifidog/templates/faq.html (modified) (2 diffs)
-
wifidog/templates/footer.html (deleted)
-
wifidog/templates/generic_error.html (modified) (2 diffs)
-
wifidog/templates/header.html (deleted)
-
wifidog/templates/header_small.html (deleted)
-
wifidog/templates/hotspot_status.html (modified) (1 diff)
-
wifidog/templates/lang_menu.html (deleted)
-
wifidog/templates/login.html (deleted)
-
wifidog/templates/login_virtual.html (deleted)
-
wifidog/templates/lost_password.html (modified) (2 diffs)
-
wifidog/templates/lost_username.html (modified) (2 diffs)
-
wifidog/templates/main.html (modified) (1 diff)
-
wifidog/templates/message_activate.html (modified) (2 diffs)
-
wifidog/templates/message_default.html (modified) (2 diffs)
-
wifidog/templates/message_denied.html (modified) (2 diffs)
-
wifidog/templates/message_failed_validation.html (modified) (2 diffs)
-
wifidog/templates/message_unknown_hotspot.html (modified) (2 diffs)
-
wifidog/templates/node_list.html (modified) (1 diff)
-
wifidog/templates/resend_validation.html (modified) (2 diffs)
-
wifidog/templates/signup.html (modified) (2 diffs)
-
wifidog/validate.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/ChangeLog
r565 r566 1 2005-04-25 Benoit Grégoire <bock@step.polymtl.ca> 2 * Integration merge, should work, but there will be display problems everywhere. Expect further commits today. 3 * Almost 100% complete Network abstraction 4 * Much better object encapsulation. Deprecated methods not removed yet. 5 * Add MainUI class. Used to display the interface. Inner workings still need work. 6 1 7 2005-04-23 François Proulx <francois.proulx@gmail.com> 2 8 * Added Preferred Size support for Flickr pictures -
trunk/wifidog-auth/wifidog/admin/content_admin.php
r553 r566 28 28 define('CONTENT_ADMIN_HREF', 'content_admin.php'); 29 29 require_once BASEPATH.'classes/Content.php'; 30 31 $ smarty->display("templates/header.html");30 require_once BASEPATH.'classes/MainUI.php'; 31 $ui=new MainUI(); 32 32 $html = ''; 33 33 … … 89 89 } 90 90 91 echo $html; 92 $smarty->display("templates/footer.html"); 91 $ui->setToolSection('ADMIN'); 92 $ui->setMainContent($html); 93 $ui->display(); 93 94 ?> 94 95 -
trunk/wifidog-auth/wifidog/admin/index.php
r559 r566 28 28 require_once 'admin_common.php'; 29 29 require_once BASEPATH.'classes/Content.php'; 30 31 $ smarty->display("templates/header.html");32 30 require_once BASEPATH.'classes/MainUI.php'; 31 $ui=new MainUI(); 32 $html = ''; 33 33 $current_user = User :: getCurrentUser(); 34 34 if(!$current_user) 35 35 { 36 $html = _('You must be logged in to access the administration panel.');36 $html = '<p class="errormsg">'._('You must be logged in to access the administration panel.')."</p>\n"; 37 37 } 38 38 else 39 39 { 40 $html = ''; 41 $html .= "<ul>\n"; 42 $html .= "<li><a href='user_log.php'>"._("User logs")."</a></li>\n"; 43 $html .= "<li><a href='online_users.php'>"._("Online Users")."</a></li>\n"; 44 $html .= "<li><a href='user_stats.php'>"._("Cumulative user statistics")."</a></li>\n"; 45 $html .= "<li><a href='hotspot_log.php'>"._("Hotspot logs")."</a></li>\n"; 46 $html .= "<li><a href='import_user_database.php'>"._("Import NoCat user database")."</a></li>\n"; 47 $html .= "<li><a href='hotspot.php'>"._("Hotspot creation and configuration")."</a> - Beta</li>\n"; 48 $html .= "<li><a href='owner_sendfiles.php'>"._("Hotspot owner administration")."</a> - Beta</li>\n"; 49 50 /* Node admin */ 51 $html .= "<div class='admin_section_container'>\n"; 52 $html .= '<form action="'.GENERIC_OBJECT_ADMIN_ABS_HREF.'" method="get">'; 53 $html .= "<div class='admin_section_title'>"._("Node administration:")." </div>\n"; 54 55 $html .= "<div class='admin_section_data'>\n"; 56 $html .= "<input type='hidden' name='action' value='edit'>\n"; 57 $html .= "<input type='hidden' name='object_class' value='Node'>\n"; 58 59 if ($current_user->isSuperAdmin()) 60 { 61 $sql_additional_where = ''; 62 } 63 else 64 { 65 $sql_additional_where = "AND node_id IN (SELECT node_id from node_owners WHERE user_id='".$current_user->getId()."')"; 66 } 67 $html .= Node :: getSelectNodeUI('object_id', $sql_additional_where); 68 $html .= "</div>\n"; 69 $html .= "<div class='admin_section_tools'>\n"; 70 71 $html .= "<input type=submit name='edit_submit' value='"._("Edit")."'>\n"; 72 $html .= "</div>\n"; 73 $html .= '</form>'; 74 $html .= "</div>\n"; 75 76 /* Network admin */ 77 $html .= "<div class='admin_section_container'>\n"; 78 $html .= '<form action="'.GENERIC_OBJECT_ADMIN_ABS_HREF.'" method="post">'; 79 $html .= "<div class='admin_section_title'>"._("Network administration:")." </div>\n"; 80 81 $html .= "<div class='admin_section_data'>\n"; 82 $html .= "<input type='hidden' name='action' value='edit'>\n"; 83 $html .= "<input type='hidden' name='object_class' value='Network'>\n"; 84 $html .= Network :: getSelectNetworkUI('object_id'); 85 $html .= "</div>\n"; 86 $html .= "<div class='admin_section_tools'>\n"; 87 88 $html .= "<input type=submit name='edit_submit' value='"._("Edit")."'>\n"; 89 $html .= "</div>\n"; 90 $html .= '</form>'; 91 $html .= "</div>\n"; 92 93 $html .= "<li><a href='content_admin.php'>"._("Content manager")."</a></li>\n"; 94 $html .= "</ul>\n"; 40 $ui->setToolSection('ADMIN'); 95 41 } 96 42 97 echo $html; 98 99 $smarty->display("templates/footer.html"); 43 $ui->setMainContent($html); 44 $ui->display(); 100 45 ?> -
trunk/wifidog-auth/wifidog/admin/templates/hotspot_display.html
r406 r566 1 {include file="templates/header.html" title="Hotspot administration"}2 3 1 <b style="position: absolute;top: 10px;right: 10px;">({$user_id})</b> <!-- DEBUG --> 4 2 … … 41 39 42 40 <p class="warning">{$error_message}</p> 43 44 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/admin/templates/hotspot_edit.html
r435 r566 1 {include file="templates/header.html" title="Hotspot administration"}2 3 1 <h3>{$title} {$smarty.const.HOTSPOT_NETWORK_NAME}</h3> 4 2 … … 79 77 <br> 80 78 <p>Work in progress note: Better DB integrity testing is needed before allowing the hotspot ID modification.</p> 81 82 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/admin/templates/hotspot_log.html
r452 r566 1 {include file="templates/header.html"}2 3 1 {section name=node loop=$nodes} 4 2 <div id="hotspot_log"> … … 130 128 131 129 </div> 132 133 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/admin/templates/hotspot_owner.html
r406 r566 1 {include file="templates/header.html" title="Hotspot administration"}2 3 1 <h3>{$title} {$smarty.const.HOTSPOT_NETWORK_NAME}</h3> 4 2 <script LANGUAGE="JavaScript"> … … 71 69 72 70 </form> 73 74 {include file="templates/footer.html"}75 -
trunk/wifidog-auth/wifidog/admin/templates/online_users.html
r516 r566 1 {include file="templates/header.html"}2 3 1 {if $error} 4 2 <div id="help"> … … 33 31 34 32 {/if} 35 36 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/admin/templates/owner_display.html
r398 r566 1 {include file="templates/header.html" title="Hotspot owner administration"}2 3 1 <b style="position: absolute;top: 10px;right: 10px;">({$user_id})</b> <!-- DEBUG --> 4 2 … … 38 36 39 37 </form> 40 41 {include file="templates/footer.html"}42 -
trunk/wifidog-auth/wifidog/admin/templates/owner_upload.html
r398 r566 1 {include file="templates/header.html" title="Hotspot owner administration"}2 3 1 <B style="position: absolute;top: 10px;right: 10px;">({$user_id})</B> <!-- DEBUG --> 4 2 … … 48 46 49 47 </form> 50 51 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/admin/templates/user_log.html
r516 r566 1 {include file="templates/header.html"}2 3 1 {if $error} 4 2 <div id="help"> … … 48 46 49 47 {/if} 50 51 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/admin/templates/user_log_detailed.html
r516 r566 1 {include file="templates/header.html"}2 3 1 {literal} 4 2 <style> … … 85 83 {/if} 86 84 </div> 87 88 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/admin/templates/user_stats.html
r516 r566 1 {include file="templates/header.html"}2 3 1 <div id="user_stats"> 4 2 … … 97 95 98 96 </div> 99 100 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/admin/user_log.php
r545 r566 39 39 try 40 40 { 41 $user = User :: get UserByID($_REQUEST['user_id']);41 $user = User :: getObject($_REQUEST['user_id']); 42 42 $userinfo = $user->getInfoArray(); 43 43 $userinfo['account_status_description'] = $account_status_to_text[$userinfo['account_status']]; … … 103 103 104 104 $smarty->assign("account_status_to_text", $account_status_to_text); 105 $smarty->display("admin/templates/user_log.html"); 105 106 require_once BASEPATH.'classes/MainUI.php'; 107 $ui=new MainUI(); 108 $ui->setToolSection('ADMIN'); 109 $ui->setMainContent($smarty->fetch("admin/templates/user_log.html")); 110 $ui->display(); 106 111 } 107 112 ?> -
trunk/wifidog-auth/wifidog/admin/user_stats.php
r545 r566 38 38 $smarty->assign("most_frequent_users", Statistics::getMostFrequentUsers(10)); 39 39 $smarty->assign("most_greedy_users", Statistics::getMostGreedyUsers(10)); 40 $smarty->display("admin/templates/user_stats.html"); 40 require_once BASEPATH.'classes/MainUI.php'; 41 $ui=new MainUI(); 42 $ui->setToolSection('ADMIN'); 43 $ui->setMainContent($smarty->fetch("admin/templates/user_stats.html")); 44 $ui->display(); 41 45 ?> -
trunk/wifidog-auth/wifidog/classes/Content.php
r562 r566 536 536 $html .= "<li class='admin_section_list_item'>\n"; 537 537 $html .= "<div class='admin_section_data'>\n"; 538 $user = User :: get UserByID($content_owner_row['user_id']);538 $user = User :: getObject($content_owner_row['user_id']); 539 539 540 540 $html .= $user->getUserListUI(); … … 694 694 foreach ($content_owner_rows as $content_owner_row) 695 695 { 696 $user = User :: get UserByID($content_owner_row['user_id']);696 $user = User :: getObject($content_owner_row['user_id']); 697 697 $user_id = $user->getId(); 698 698 $name = "content_".$this->id."_owner_".$user->GetId()."_remove"; -
trunk/wifidog-auth/wifidog/classes/Locale.php
r545 r566 1 1 <?php 2 2 3 3 4 /********************************************************************\ … … 35 36 private $mLang; 36 37 private $mPays; 37 // Associations 38 39 /** Get the Locale object 40 * @param $content_id The content id 41 * @return the Content object, or null if there was an error (an exception is also thrown) 42 */ 43 static function getObject($locale_id) 44 { 45 46 return new self($locale_id); 47 } 48 49 public static function getCurrentLocale() 50 { 51 global $session; 52 $object = null; 53 $locale_id = $session->get(SESS_LANGUAGE_VAR); 54 if (empty ($locale_id)) 55 { 56 $object = new self(DEFAULT_LANG); 57 } 58 else 59 { 60 $object = new self($locale_id); 61 } 62 return $object; 63 64 } 65 66 /** 67 * @return true on success, false on failure 68 */ 69 public static function setCurrentLocale($locale) 70 { 71 global $session; 72 $retval = false; 73 if ($locale != null) 74 { 75 $locale_id = $locale->getId(); 76 $session->set(SESS_LANGUAGE_VAR, $locale_id); 77 $retval = true; 78 } 79 else 80 { 81 $locale_id = DEFAULT_LANG; 82 $session->set(SESS_LANGUAGE_VAR, $locale_id); 83 $retval = false; 84 } 85 /* Gettext support */ 86 if (!function_exists('gettext')) 87 { 88 define('GETTEXT_AVAILABLE', false); 89 /* Redefine the gettext functions if gettext isn't installed */ 90 function gettext($string) 91 { 92 return $string; 93 } 94 function _($string) 95 { 96 return $string; 97 } 98 } 99 else 100 { 101 define('GETTEXT_AVAILABLE', true); 102 } 103 104 if (GETTEXT_AVAILABLE) 105 { 106 $current_locale = setlocale(LC_ALL, $locale_id); 107 if (setlocale(LC_ALL, $locale_id) != $locale_id) 108 { 109 echo "Warning: language.php: Unable to setlocale() to ".$locale_id.", return value: $current_locale, current locale: ".setlocale(LC_ALL, 0); 110 } 111 112 bindtextdomain('messages', BASEPATH.'/locale'); 113 bind_textdomain_codeset('messages', 'UTF-8'); 114 textDomain('messages'); 115 116 putenv("LC_ALL=".$locale_id); 117 putenv("LANGUAGE=".$locale_id); 118 } 119 return $retval; 120 121 } 38 122 39 123 /** Example: 'fr_CA_montreal' will give … … 68 152 * @return A sql fragment 69 153 */ 70 public static function getSqlCaseStringSelect($locale_id) 71 { 72 $decomposed_locale = Locale :: decomposeLocaleId($locale_id); 73 154 public static function getSqlCaseStringSelect($locale_id) 155 { 156 $decomposed_locale = Locale :: decomposeLocaleId($locale_id); 74 157 75 158 $sql = " (CASE\n"; … … 88 171 //On cherche une chaine n'ayant pas de locale associée, elle a plue de chance d'être lisible qu'une chaîne prise au hasard 89 172 $sql .= " WHEN locales_id IS NULL THEN 5\n"; 90 173 91 174 $sql .= " ELSE 20 "; 92 175 $sql .= " END)\n"; 93 176 return $sql; 94 177 } 95 178 96 179 /**Constructeur 97 180 @param string locale Locale in POSIX format (excluding charset), such as fr ou fr_CA: "xx(x)_YY_(n*z)". Both '_' and '-' are acceptable as separator. … … 127 210 } 128 211 129 public function GetId()130 {131 return $this->mId;132 }212 public function GetId() 213 { 214 return $this->mId; 215 } 133 216 /**Indique si la clef primaire de l'objet est une chaîne de caractère. 134 217 */ … … 182 265 function Export($export_format, & $document, $parent, $entree = null) 183 266 { 184 // $sql = "SELECT locales_id FROM locales WHERE locales_id='$this->mId'";185 // $this->mBd->executerSqlResUnique($sql, $locales_row, false);186 187 $language = $document->createElementNS(LOM_EXPORT_NS, "Language");188 $parent->appendChild($language);189 $textnode = $document->createTextNode($this->mId);190 $language->appendChild($textnode);191 } 192 267 // $sql = "SELECT locales_id FROM locales WHERE locales_id='$this->mId'"; 268 // $this->mBd->executerSqlResUnique($sql, $locales_row, false); 269 270 $language = $document->createElementNS(LOM_EXPORT_NS, "Language"); 271 $parent->appendChild($language); 272 $textnode = $document->createTextNode($this->mId); 273 $language->appendChild($textnode); 274 } 275 193 276 /* 194 277 * Returns a HTML formatted string for output to string ( with an image ) … … 242 325 echo $this->GetString(); 243 326 } 244 327 245 328 /** 246 329 * By definition a Locale cannot be empty … … 250 333 return false; 251 334 } 252 335 253 336 /** 254 337 * Checks if the object complies with the specified profile settings … … 258 341 function IsCompliant($obligation) 259 342 { 260 switch ($obligation)261 { 262 case 'MANDATORY' :263 if ($this->isEmpty())343 switch ($obligation) 344 { 345 case 'MANDATORY' : 346 if ($this->isEmpty()) 264 347 return NOT_COMPLIANT_MASK; 265 348 break; 266 case 'RECOMMENDED' :267 if ($this->isEmpty())349 case 'RECOMMENDED' : 350 if ($this->isEmpty()) 268 351 return NOT_ALL_RECOMMENDED; 269 352 break; -
trunk/wifidog-auth/wifidog/classes/LocaleList.php
r553 r566 43 43 global $db; 44 44 $this->mBd = & $db; //for backward compatibility 45 }46 47 /**Indique si la clef primaire de l'objet est une chaîne de caractère.48 */49 function PrimaryKeyIsString()50 {51 return true;52 45 } 53 46 … … 123 116 } 124 117 125 /**Exporte l'élément dans un format d'échange126 @param $export_format format de la sortie127 @param $document Le document auquel la sortie doit être ajouté. Le type peut varier128 @param $parent Le parent de l'élément à ajouter. Le type peut varier129 @param $entree ID de l'entree de vocabulaire130 */131 function Export($export_format, & $document, $parent, $entree = null)132 {133 if ($entree != null)134 {135 $langue = new Locale($entree);136 $langue->Export($export_format, $document, $parent);137 }138 }139 140 function isEmpty()141 {142 return false;143 }144 145 /**146 * By definition it cannot be considerend empty, so it's always compliant'147 * @return boolean148 */149 function isCompliant($profile, $lom_element)150 {151 return COMPLIANT_MASK;152 }153 118 154 119 } /* end class LocaleList */ -
trunk/wifidog-auth/wifidog/classes/Network.php
r554 r566 72 72 global $AUTH_SOURCE_ARRAY; 73 73 $html = ''; 74 $name = "{$user_prefix}";75 $html .= "Network:\n";74 $name = $user_prefix; 75 $html .= _("Network:")." \n"; 76 76 $number_of_networks = count($AUTH_SOURCE_ARRAY); 77 77 if ($number_of_networks > 1) … … 133 133 return $this->id; 134 134 } 135 136 /** Retreives the network name 137 * @return The id */ 138 public function getTechSupportEmail() 139 { 140 return TECH_SUPPORT_EMAIL; 141 } 142 143 /** Retreives the network name 144 * @return The id */ 145 public function getName() 146 { 147 return HOTSPOT_NETWORK_NAME; 148 } 149 150 /** Retreives the network's homepage url 151 * @return The id */ 152 public function getHomepageURL() 153 { 154 return HOTSPOT_NETWORK_URL; 155 } 156 157 135 158 /**Get an array of all Content linked to the network 136 159 * @return an array of Content or an empty arrray */ … … 153 176 /** Retreives the admin interface of this object. 154 177 * @return The HTML fragment for this interface */ 178 179 /** Get the Authenticator object for this network */ 180 public function getAuthenticator() 181 { 182 global $AUTH_SOURCE_ARRAY; 183 return $AUTH_SOURCE_ARRAY[$this->id]['authenticator']; 184 } 185 155 186 public function getAdminUI() 156 187 { -
trunk/wifidog-auth/wifidog/classes/Node.php
r555 r566 57 57 else 58 58 { 59 $object = getCurrentRealNode();59 $object = self::getCurrentRealNode(); 60 60 } 61 61 return $object; … … 74 74 * @param * @return a Node object, or null if it can't be found. 75 75 */ 76 public function getCurrentRealNode()76 public static function getCurrentRealNode() 77 77 { 78 78 global $db; … … 484 484 } 485 485 486 /** The list of users online at this node 487 * @return An array of User object, or en empty array */ 486 488 function getOnlineUsers() 487 489 { 488 490 global $db; 489 490 $db->ExecSql("SELECT users.user_id, users.username, users.account_origin FROM users,connections WHERE connections.token_status='".TOKEN_INUSE."' AND users.user_id=connections.user_id AND connections.node_id='{$this->id}'", $users, false); 491 $retval=array(); 492 $db->ExecSql("SELECT users.user_id FROM users,connections WHERE connections.token_status='".TOKEN_INUSE."' AND users.user_id=connections.user_id AND connections.node_id='{$this->id}'", $users, false); 493 if($users!=null) 494 { 495 foreach ($users as $user_row) 496 { 497 $retval[]=getObject($user_row['user_id']); 498 } 499 } 491 500 return $users; 492 501 } … … 548 557 } 549 558 559 /** Warning, the semantics of this function will change */ 550 560 public static function getAllOnlineUsers() 551 561 { -
trunk/wifidog-auth/wifidog/classes/SmartyWifidog.php
r553 r566 39 39 class SmartyWifidog extends Smarty { 40 40 41 function SmartyWifidog()41 function __construct() 42 42 { 43 43 -
trunk/wifidog-auth/wifidog/classes/User.php
r553 r566 33 33 34 34 /** Instantiate a user object 35 * @param $id The id of the requested user35 * @param $id The user id of the requested user 36 36 * @return a User object, or null if there was an error 37 37 */ 38 public static function get UserByID($id)38 public static function getObject($id) 39 39 { 40 40 $object = null; -
trunk/wifidog-auth/wifidog/config.php
r563 r566 7 7 * 8 8 * $Log$ 9 * Revision 1.37 2005/04/25 13:16:06 benoitg 10 * 2005-04-25 Benoit Gr�goire <bock@step.polymtl.ca> 11 * * Integration merge, should work, but there will be display problems everywhere. Expect further commits today. 12 * * Almost 100% complete Network abstraction 13 * * Much better object encapsulation. Deprecated methods not removed yet. 14 * * Add MainUI class. Used to display the interface. Inner workings still need work. 15 * 9 16 * Revision 1.36 2005/04/23 22:11:17 fproulx 10 17 * 2005-04-23 François Proulx <francois.proulx@gmail.com> … … 205 212 define('CONF_DBMS',DBMS_POSTGRES); 206 213 214 /* Available Locales (Languages) */ 215 $AVAIL_LOCALE_ARRAY=array('fr'=>'Français', 216 'en'=>'English'); 217 207 218 /***** You should normally not have to edit anything below this ******/ 208 219 define('WIFIDOG_NAME', 'WiFiDog Authentication server'); … … 251 262 define('LOGIN_PAGE_NAME', 'login.html'); 252 263 define('PORTAL_PAGE_NAME', 'portal.html');/**< @deprecated version - 19-Apr-2005*/ 253 define('PAGE_HEADER_NAME', 'header.html'); 254 define('PAGE_FOOTER_NAME', 'footer.html'); 264 define('PAGE_HEADER_NAME', 'header.html');/**< @deprecated version - 19-Apr-2005*/ 265 define('PAGE_FOOTER_NAME', 'footer.html');/**< @deprecated version - 19-Apr-2005*/ 255 266 define('HOTSPOT_STATUS_PAGE', 'hotspot_status.php'); 256 267 define('HOTSPOT_LOGO_NAME', 'hotspot_logo.jpg'); … … 264 275 265 276 define('DEFAULT_NODE_ID', 'default'); 266 define('DEFAULT_LANG', 'fr _FR');277 define('DEFAULT_LANG', 'fr'); 267 278 268 279 -
trunk/wifidog-auth/wifidog/hotspot_status.php
r516 r566 525 525 } 526 526 $smarty->assign("num_deployed_nodes", count($node_results)); 527 $smarty->assign("title", "hotspot_status"); 528 $smarty->display("templates/hotspot_status.html"); 527 528 529 require_once BASEPATH.'classes/MainUI.php'; 530 $ui=new MainUI(); 531 //$ui->setToolSection('ADMIN'); 532 $ui->setTitle(_("Hotspot list")); 533 $ui->setMainContent($smarty->fetch("templates/hotspot_status.html")); 534 $ui->display(); 529 535 } 530 536 ?> -
trunk/wifidog-auth/wifidog/include/common.php
r553 r566 49 49 define('SESS_GW_PORT_VAR', 'SESS_GW_PORT'); 50 50 define('SESS_GW_ID_VAR', 'SESS_GW_ID'); 51 52 /* Languages and sessions */53 $lang_ids = array(54 "fr",55 "en"56 );57 $lang_names = array(58 "Français",59 "English"60 );61 51 62 52 /* End */ -
trunk/wifidog-auth/wifidog/include/language.php
r553 r566 1 1 <?php 2 2 require_once BASEPATH.'classes/Session.php'; 3 require_once BASEPATH.'classes/Locale.php'; 3 4 $session = new Session(); 4 /* Gettext support */5 if(!function_exists ('gettext'))6 {7 define('GETTEXT_AVAILABLE', false);8 /* Redefine the gettext functions if gettext isn't installed */9 function gettext($string)10 {11 return $string;12 }13 function _($string)14 {15 return $string;16 }17 }18 else19 {20 define('GETTEXT_AVAILABLE', true);21 }22 5 23 if (!empty($_REQUEST['lang'])) { 24 $session->set('SESS_LANGUAGE_VAR', $_REQUEST['lang']); 6 if (!empty ($_REQUEST['lang'])) 7 { 8 Locale::setCurrentLocale(Locale::getObject($_REQUEST['lang'])); 25 9 } 26 10 27 if ($session->get('SESS_LANGUAGE_VAR')) { 28 setlocale(LC_ALL, $session->get('SESS_LANGUAGE_VAR')); 29 } 30 31 if (GETTEXT_AVAILABLE) { 32 $current_locale = setlocale(LC_ALL, DEFAULT_LANG); 33 if (setlocale(LC_ALL, DEFAULT_LANG) != DEFAULT_LANG) { 34 echo "Warning: language.php: Unable to setlocale() to ".DEFAULT_LANG.", return value: $current_locale, current locale: ". setlocale(LC_ALL, 0); 35 } 36 37 bindtextdomain('messages', BASEPATH.'/locale'); 38 bind_textdomain_codeset('messages', 'UTF-8'); 39 textDomain('messages'); 40 41 if (!empty($_REQUEST['lang']) && isset($session)) { 42 $session->set(SESS_LANGUAGE_VAR, $_REQUEST['lang']); 43 } 44 45 if (isset($session) && $session->get(SESS_LANGUAGE_VAR)) { 46 putenv("LC_ALL=".$session->get(SESS_LANGUAGE_VAR)); 47 putenv("LANGUAGE=".$session->get(SESS_LANGUAGE_VAR)); 48 setlocale(LC_ALL, $session->get(SESS_LANGUAGE_VAR)); 49 if (isset($smarty)) { 50 $smarty->assign("lang_id", $session->get(SESS_LANGUAGE_VAR)); 51 } 52 } else { 53 putenv("LC_ALL=" . DEFAULT_LANG); 54 putenv("LANGUAGE=" . DEFAULT_LANG); 55 setlocale(LC_ALL, DEFAULT_LANG); 56 $smarty->assign("lang_id", DEFAULT_LANG); 57 } 58 59 if (isset($smarty)) { 60 $smarty->assign("lang_ids", $lang_ids); 61 $smarty->assign("lang_names", $lang_names); 62 } 63 } 11 $locale = Locale::getCurrentLocale(); 12 $locale_id = $locale->getId(); 13 if (isset ($smarty)) 14 { 15 $smarty->assign("lang_id", $locale_id); 16 } 64 17 ?> -
trunk/wifidog-auth/wifidog/index.php
r544 r566 20 20 \********************************************************************/ 21 21 /**@file index.php 22 * Authserver home page 22 23 * @author Copyright (C) 2004 Benoit Gr�goire 23 24 */ … … 27 28 require_once BASEPATH.'include/common_interface.php'; 28 29 require_once BASEPATH.'classes/Node.php'; 30 require_once BASEPATH.'classes/MainUI.php'; 29 31 30 32 $smarty->assign("num_valid_users", $stats->getNumValidUsers()); … … 32 34 33 35 $smarty->assign("title", _("authentication server")); 34 $smarty->display("templates/main.html"); 36 $ui=new MainUI(); 37 $ui->setMainContent($smarty->fetch("templates/main.html")); 38 $ui->display(); 35 39 ?> -
trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css
r565 r566 1 1 {literal} 2 body { 3 {/literal} 4 background: #fff url({$common_content_url}back.gif) repeat-y; 5 {literal} 6 margin: 0; 7 font-family: helvetica; 8 font-size: 90%; 9 color: #628C53; 10 } 11 12 #head { 13 {/literal} 14 background: #CCE0C5 url({$common_content_url}h1_back.gif) repeat-x; 15 {literal} 16 } 17 18 h1 { 19 {/literal} 20 background: url({$common_content_url}head.gif) no-repeat top left; 21 {literal} 22 margin: 0; 23 padding: 7px 2px 2px 186px; 24 height: 50px; 25 font-weight: normal; 26 font-size: 1.5em; 27 text-align: center; 28 color: #fff; 29 } 30 31 h2 { 32 /*clear: both;*/ 33 border-bottom: 1px solid #BFDCB5; 34 color: #628C53; 35 } 36 37 #login { 38 background: #CCE0C5; 39 padding: 2px 10px; 40 text-align: right; 41 font-size: 0.9em; 42 color: #628C53; 43 } 44 45 #login form, #login p { 46 margin: 0; 47 } 48 49 #login span { 50 padding-right: 20px; 51 font-weight: bold; 52 } 53 54 #content { 55 float: none; 56 margin-left: 186px; 57 padding: 10px; 58 border-top: 1px solid #BFDCB5; 59 } 60 61 #navLeft { 62 float: left; 63 width: 186px; 64 color: #628C53; 65 } 66 67 #navLeft ul { 68 margin-left: 15px; 69 padding-left: 0; 70 list-style-type: none; 71 } 72 73 #navLeft ul li { 74 padding: 3px 0; 75 } 76 77 #navLeft a { 78 color: #35952A; 79 } 80 81 #navLeft a:hover { 82 color: #FB7F44; 83 } 84 85 #navLeft h3 { 86 margin-left: 15px; 87 font-size: 1.2em; 88 } 2 body{ 3 margin: 0px; 4 padding: 0px; 5 font-family: arial, sans-serif; 6 color: #616756; 7 font-size: 11px; 8 overflow: hidden; 9 } 10 11 .outer_container 12 { 13 margin-left: 252px; /* L+2*left border */ 14 border-left: 1px solid #000; 15 background-color: #fcd; 16 } 17 18 #tool_section{ 19 border: 1px solid #E9E9E9; 20 float:left; 21 float: left; 22 position: relative; 23 width: 250px; /* L */ 24 margin-left: -254px; /* -L-1-2*left border- 2* right border */ 25 margin-right: 2px; 26 } 27 28 #main_section{ 29 border: 1px solid #E9E9E9; 30 float:right; 31 width: 100%; 32 margin-left: -1px; 33 } 34 35 div.tool_user_info{ 36 background: #C8FF7A; 37 background-color: #C8FF7A; 38 vertical-align: middle; 39 } 40 span.tool_user_info{ 41 position: relative; 42 top: 3px; 43 bottom: 3px; 44 } 45 div.navigation{ 46 width: 250px; 47 height: 38px; 48 text-align: center; 49 {/literal} 50 background-image: url(../images/01_nav.gif); 51 {literal} 52 background-repeat: repeat; 53 background-position: left top; 54 overflow: hidden; 55 } 56 span.navigation{ 57 position: relative; 58 top: 10px; 59 } 60 div.language{ 61 width: 250px; 62 height: 30px; 63 } 64 form.language{ 65 position: relative; 66 top: 5px; 67 right: 5px; 68 text-align: right; 69 } 70 .tool_content{ 71 width: 250px; 72 overflow: hidden; 73 } 74 75 div.avis{ 76 width: 250px; 77 height: 200px; 78 {/literal} 79 background-image: url(../images/03_avis.gif); 80 {literal} 81 background-repeat: repeat-x; 82 background-position: left top; 83 background-color: #FDFDFD; 84 } 85 span.avis{ 86 position: relative; 87 top: 20px; 88 left: 10px; 89 } 90 div.anysection{ 91 padding: 0px 5px 0px 5px; 92 font-family: arial, sans-serif; 93 color: #616756; 94 font-size: 11px; 95 text-align: left; 96 } 97 div.test{ 98 text-align: center; 99 vertical-align: text-top; 100 } 101 h1{ 102 font-family: verdana, sans-serif; 103 color: #88AA4B; 104 font-size: 14px; 105 } 106 form{ 107 padding: 0px; 108 margin: 0px; 109 } 110 img.separator{ 111 display: inline; 112 position: relative; 113 top: 0px; 114 vertical-align: text-top; 115 } 116 img.administration{ 117 vertical-align: middle; 118 } 119 a{ 120 font-family: arial, sans-serif; 121 color: #616756; 122 font-size: 11px; 123 text-decoration: underline; 124 } 125 a:hover{ 126 font-family: arial, sans-serif; 127 color: #88AA4B; 128 font-size: 11px; 129 text-decoration: underline; 130 } 131 a.administration{ 132 margin: 5px; 133 font-family: arial, sans-serif; 134 color: #616756; 135 font-size: 11px; 136 font-weight: bold; 137 text-decoration: none; 138 } 139 a.navigation{ 140 position: relative; 141 top: 10px; 142 padding-left: 5px; 143 padding-right: 5px; 144 font-family: arial, sans-serif; 145 color: #616756; 146 font-size: 11px; 147 text-decoration: none; 148 } 149 .indent{ 150 padding-left: 25px; 151 } 152 153 select{ 154 font-family: arial, sans-serif; 155 color: #616756; 156 font-size: 11px; 157 border: 1px solid #C8FF7A; 158 background: #C8FF7A; 159 } 160 161 162 /*********************************************************************/ 89 163 90 164 .logos { … … 93 167 } 94 168 95 p.sidenote {96 margin: 20px 10px;97 padding: 10px 5px;98 border: 1px solid #BFDCB5;99 }100 101 .hotspot {102 padding: 5px;103 border: 1px solid #BFDCB5;104 }105 106 107 .warning {108 color:red;109 font:bold 14px/18px verdana, arial, helvetica, sans-serif;110 margin:0px 0px 5px 10px;111 padding:0px;112 }113 114 .spreadsheet { border: thin solid lightblue ; text-align:left}115 TH.spreadsheet { background-color: lightgrey}116 TABLE.spreadsheet { border: solid darkblue ; text-align:left}117 TABLE.spreadsheet_user { border: thin solid lightblue ; padding:0px; margin:0px;}118 TH.th_left { background-color: lightgrey ; text-align:left}119 TH.th_section { background-color: silver ; text-align:center}120 TD.spreadsheet_user { /*background-color: lightgray;*/ }121 .popup { background-color: white; border: solid darkblue ; text-align:left}122 .link { color: blue; text-decoration: underline }123 A:link { color: blue }124 A:active { color: red; /* font-size: 125% */}125 A:visited { font-size: 85% }126 127 #node_list { float: left; }128 #node_list table { background-color: #b1d5ba; border-collapse: collapse; width: 100%; }129 #node_list tr { background-color: #e1f5da; border: 1px solid; }130 #node_list tr.even { background-color: #e1f5da; }131 #node_list tr.odd { background-color: #b1d5ba; }132 #node_list td { margin: 0 0 0 0; text-align: center; color: #000000; }133 #node_list td.status { width: 15em; text-align: left; font-size: 9pt; }134 #node_list a { color: #000000; }135 136 #hotspot_status { float: left; }137 #hotspot_status table { background-color: #b1d5ba; border-collapse: collapse; width: 100%; }138 #hotspot_status tr { vertical-align: top; font-size: 10pt; font-family: Arial; background-color: #e1f5da; border: 1px solid; }139 #hotspot_status tr.even { background-color: #e1f5da; }140 #hotspot_status tr.odd { background-color: #b1d5ba; }141 #hotspot_status td { margin: 0 0 0 0; color: #000000; }142 #hotspot_status a { color: #000000; }143 144 #hotspot_log { margin: 1em; }145 #hotspot_log table { background-color: #b1d5ba; border-collapse: collapse; }146 #hotspot_log th { background-color: #e1f5da; border: 1px solid; text-align: left; }147 #hotspot_log tr { background-color: #ffffff; border: 1px solid; }148 #hotspot_log td { margin: 0 0 0 0; color: #000000; }149 #hotspot_log td.status { width: 15em; text-align: left; font-size: 9pt; }150 #hotspot_log a { color: #000000; }151 152 #user_stats { float: left; }153 #user_stats table { background-color: #b1d5ba; border-collapse: collapse; }154 #user_stats th { background-color: #e1f5da; border: 1px solid; }155 #user_stats tr { background-color: #ffffff; border: 1px solid; }156 #user_stats td { margin: 0 0 0 0; color: #000000; }157 #user_stats td.status { width: 15em; text-align: left; font-size: 9pt; }158 #user_stats a { color: #000000; }159 160 #std_table { float: left; }161 #std_table table { border: 1px solid gray; }162 #std_table th { font-size: 14pt; background-color: #e1f5da;}163 #std_table td.item { font-weight: bold; }164 169 165 170 /** Messages */ … … 287 292 clear: left; 288 293 } 294 295 .spreadsheet { border: thin solid lightblue ; text-align:left} 296 TH.spreadsheet { background-color: lightgrey} 297 TABLE.spreadsheet { border: solid darkblue ; text-align:left} 298 TABLE.spreadsheet_user { border: thin solid lightblue ; padding:0px; margin:0px;} 299 TH.th_left { background-color: lightgrey ; text-align:left} 300 TH.th_section { background-color: silver ; text-align:center} 301 TD.spreadsheet_user { /*background-color: lightgray;*/ } 302 .popup { background-color: white; border: solid darkblue ; text-align:left} 303 .link { color: blue; text-decoration: underline } 304 305 #node_list { float: left; } 306 #node_list table { background-color: #b1d5ba; border-collapse: collapse; width: 100%; } 307 #node_list tr { background-color: #e1f5da; border: 1px solid; } 308 #node_list tr.even { background-color: #e1f5da; } 309 #node_list tr.odd { background-color: #b1d5ba; } 310 #node_list td { margin: 0 0 0 0; text-align: center; color: #000000; } 311 #node_list td.status { width: 15em; text-align: left; font-size: 9pt; } 312 #node_list a { color: #000000; } 313 314 #hotspot_status { float: left; } 315 #hotspot_status table { background-color: #b1d5ba; border-collapse: collapse; width: 100%; } 316 #hotspot_status tr { vertical-align: top; font-size: 10pt; font-family: Arial; background-color: #e1f5da; border: 1px solid; } 317 #hotspot_status tr.even { background-color: #e1f5da; } 318 #hotspot_status tr.odd { background-color: #b1d5ba; } 319 #hotspot_status td { margin: 0 0 0 0; color: #000000; } 320 #hotspot_status a { color: #000000; } 321 322 #hotspot_log { margin: 1em; } 323 #hotspot_log table { background-color: #b1d5ba; border-collapse: collapse; } 324 #hotspot_log th { background-color: #e1f5da; border: 1px solid; text-align: left; } 325 #hotspot_log tr { background-color: #ffffff; border: 1px solid; } 326 #hotspot_log td { margin: 0 0 0 0; color: #000000; } 327 #hotspot_log td.status { width: 15em; text-align: left; font-size: 9pt; } 328 #hotspot_log a { color: #000000; } 329 330 #user_stats { float: left; } 331 #user_stats table { background-color: #b1d5ba; border-collapse: collapse; } 332 #user_stats th { background-color: #e1f5da; border: 1px solid; } 333 #user_stats tr { background-color: #ffffff; border: 1px solid; } 334 #user_stats td { margin: 0 0 0 0; color: #000000; } 335 #user_stats td.status { width: 15em; text-align: left; font-size: 9pt; } 336 #user_stats a { color: #000000; } 337 338 #std_table { float: left; } 339 #std_table table { border: 1px solid gray; } 340 #std_table th { font-size: 14pt; background-color: #e1f5da;} 341 #std_table td.item { font-weight: bold; } 342 289 343 {/literal} -
trunk/wifidog-auth/wifidog/login/index.php
r553 r566 1 1 <?php 2 2 3 3 4 // $Id$ … … 31 32 require_once BASEPATH.'classes/Node.php'; 32 33 require_once BASEPATH.'classes/User.php'; 34 require_once BASEPATH.'classes/Network.php'; 33 35 34 if (!empty ($_REQUEST['url'])) { 36 if (!empty ($_REQUEST['url'])) 37 { 35 38 $session->set(SESS_ORIGINAL_URL_VAR, $_REQUEST['url']); 36 39 } 37 40 38 if (!empty ($_REQUEST['username']) && !empty ($_REQUEST['password']) && !empty ($_REQUEST['auth_source'])) { 41 if (!empty ($_REQUEST['username']) && !empty ($_REQUEST['password']) && !empty ($_REQUEST['auth_source'])) 42 { 39 43 $errmsg = ''; 40 44 $username = $db->EscapeString($_REQUEST['username']); 41 $auth_source = $db->EscapeString($_REQUEST['auth_source']);42 45 43 // Authenticating the user through the s selected auth source.44 $user = $AUTH_SOURCE_ARRAY[$auth_source]['authenticator']->login($_REQUEST['username'], $_REQUEST['password'], $errmsg);46 // Authenticating the user through the selected auth source. 47 $network = Network::processSelectNetworkUI('auth_source'); 45 48 46 if ($user != null) { 47 if (isset ($_REQUEST['gw_address']) && isset ($_REQUEST['gw_port']) && ($token = $user->generateConnectionToken())) { 49 $user = $network->getAuthenticator()->login($_REQUEST['username'], $_REQUEST['password'], $errmsg); 50 if ($user != null) 51 { 52 if (isset ($_REQUEST['gw_address']) && isset ($_REQUEST['gw_port']) && ($token = $user->generateConnectionToken())) 53 { 48 54 header("Location: http://".$_REQUEST['gw_address'].":".$_REQUEST['gw_port']."/wifidog/auth?token=$token"); 49 } else { 55 } 56 else 57 { 50 58 /* Virtual login */ 51 59 header("Location: ".BASE_NON_SSL_PATH); 52 60 } 53 61 exit; 54 } else {55 $smarty->assign("error", $errmsg);56 62 } 57 } else { 58 59 $smarty->assign("error", _('Your must specify your username and password')); 63 else 64 { 65 $error = $errmsg; 66 } 67 } 68 else 69 { 70 $error = _('Your must specify your username and password'); 60 71 } 61 72 … … 65 76 isset ($_REQUEST["auth_source"]) && $smarty->assign('selected_auth_source', $_REQUEST["auth_source"]); 66 77 67 if (isset ($_REQUEST['gw_id'])) { 68 $smarty->assign("gw_id", $_REQUEST['gw_id']); 78 $node=null; 79 if (!empty ($_REQUEST['gw_id'])) 80 { 81 $gw_id=$_REQUEST['gw_id']; 69 82 70 try { 71 $node = Node :: getObject($db->EscapeString(CURRENT_NODE_ID)); 72 $smarty->assign('hotspot_name', $node->getName()); 73 } catch (Exception $e) { 83 try 84 { 85 $node = Node :: getObject($_REQUEST['gw_id']); 86 $hotspot_name = $node->getName(); 87 } 88 catch (Exception $e) 89 { 74 90 $smarty->assign("error", $e->getMessage()); 75 91 $smarty->display("templates/generic_error.html"); 76 92 exit; 77 93 } 78 } else { 94 } 95 else 96 { 79 97 /* Gateway ID is not set... Virtual login */ 80 $smarty->display("templates/login_virtual.html");81 exit;82 98 } 83 99 84 isset ($_REQUEST["username"]) && $ smarty->assign('username', $_REQUEST["username"]);85 isset ($_REQUEST["gw_address"]) && $ smarty->assign('gw_address', $_REQUEST['gw_address']);86 isset ($_REQUEST["gw_port"]) && $ smarty->assign('gw_port', $_REQUEST['gw_port']);87 isset ($_REQUEST["gw_id"]) && $ smarty->assign('gw_id', $_REQUEST['gw_id']);100 isset ($_REQUEST["username"]) && $username = $_REQUEST["username"]; 101 isset ($_REQUEST["gw_address"]) && $gw_address = $_REQUEST['gw_address']; 102 isset ($_REQUEST["gw_port"]) && $gw_port = $_REQUEST['gw_port']; 103 isset ($_REQUEST["gw_id"]) && $gw_id = $_REQUEST['gw_id']; 88 104 89 105 isset ($_REQUEST["gw_address"]) && $session->set(SESS_GW_ADDRESS_VAR, $_REQUEST['gw_address']); … … 91 107 isset ($_REQUEST["gw_id"]) && $session->set(SESS_GW_ID_VAR, $_REQUEST['gw_id']); 92 108 93 $smarty->display("templates/".LOGIN_PAGE_NAME); 109 $html = ''; 110 $html .= '<div id="form">'."\n"; 111 if (empty ($_REQUEST['gw_id'])) 112 { 113 $html .= '<h3>'._("This is the 'virtual login' page you can use to get the credentials which will then give you access to management functions on the network without being at a hotspot.").'</h3>'."\n"; 114 } 115 else 116 { 117 $html .= '<h3>'._("Welcome! Hotspot:")." $hotspot_name</h3>\n"; 118 } 119 120 $html .= '<h3>'._("Please log-in or").'<br><a href="'.BASE_SSL_PATH.'signup.php">'._("Sign-up, it's free!").'</a></h3>'."\n"; 121 122 $html .= '<form name="login_form" method="post">'."\n"; 123 if($node!=null) 124 { 125 $html .= '<input type="hidden" name="gw_address" value="'.$gw_address.'">'."\n"; 126 $html .= '<input type="hidden" name="gw_port" value="'.$gw_port.'">'."\n"; 127 $html .= '<input type="hidden" name="gw_id" value="'.$gw_id.'">'."\n"; 128 } 129 $html .= '<table>'."\n"; 130 $html .= Network::getSelectNetworkUI('auth_source'); 131 $html .= '<tr>'."\n"; 132 $html .= '<td>'._("Username (or email)").':</td>'."\n"; 133 $html .= '<td><input type="text" name="username" value="'.$username.'" size="20"></td>'."\n"; 134 $html .= '</tr>'."\n"; 135 $html .= '<tr>'."\n"; 136 $html .= '<td>'._("Password").':</td>'."\n"; 137 $html .= '<td><input type="password" name="password" size="20"></td>'."\n"; 138 $html .= '</tr>'."\n"; 139 $html .= '<tr>'."\n"; 140 $html .= '<td></td>'."\n"; 141 $html .= '<td><input class="submit" type="submit" name="submit" value="'._("Login").'"></td>'."\n"; 142 $html .= '</tr>'."\n"; 143 $html .= '</table>'."\n"; 144 $html .= '</form>'."\n"; 145 146 $html .= '<h3>'._("I already have an account, but").':</h3>'."\n"; 147 $html .= '<ul>'."\n"; 148 $html .= '<li><a href="'.BASE_SSL_PATH.'lost_username.php">'._("I Forgot my username").'</a><br>'."\n"; 149 $html .= '<li><a href="'.BASE_SSL_PATH.'lost_password.php">'._("I Forgot my password").'</a>'."\n"; 150 $html .= '<li><a href="'.BASE_SSL_PATH.'resend_validation.php">'._("Re-send the validation email").'</a><br>'."\n"; 151 if ($error) 152 { 153 $class = 'class="help"'; 154 } 155 else 156 { 157 $class = ''; 158 } 159 $html .= '<li><a href="'.BASE_SSL_PATH.'faq.php">'._("I have trouble connecting and I would like some help").'</a><br>'."\n"; 160 $html .= '</ul>'."\n"; 161 $html .= '</div>'."\n"; 162 163 if ($error) 164 { 165 $html .= '<div id="help">'."\n"; 166 $html .= "$error\n"; 167 $html .= '</div>'."\n"; 168 } 169 170 require_once BASEPATH.'classes/MainUI.php'; 171 $ui = new MainUI(); 172 $ui->setMainContent($html); 173 $ui->display(); 94 174 ?> 95 175 176 177 -
trunk/wifidog-auth/wifidog/node_list.php
r405 r566 35 35 } 36 36 37 $smarty->display("templates/node_list.html"); 37 require_once BASEPATH.'classes/MainUI.php'; 38 $ui=new MainUI(); 39 //$ui->setToolSection('ADMIN'); 40 $ui->setMainContent($smarty->fetch("templates/node_list.html")); 41 $ui->display(); 38 42 ?> -
trunk/wifidog-auth/wifidog/portal/index.php
r554 r566 1 1 <?php 2 // $Id$3 /********************************************************************\4 * This program is free software; you can redistribute it and/or *5 * modify it under the terms of the GNU General Public License as *6 * published by the Free Software Foundation; either version 2 of *7 * the License, or (at your option) any later version. *8 * *9 * This program is distributed in the hope that it will be useful, *10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *12 * GNU General Public License for more details. *13 * *14 * You should have received a copy of the GNU General Public License*15 * along with this program; if not, contact: *16 * *17 * Free Software Foundation Voice: +1-617-542-5942 *18 * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *19 * Boston, MA 02111-1307, USA gnu@gnu.org *20 * *21 \********************************************************************/22 /**@file index.php Displays the portal page23 * @author Copyright (C) 2004 Benoit Gr�goire et Philippe April24 */25 2 26 define('BASEPATH','../'); 3 // $Id$ 4 /********************************************************************\ 5 * This program is free software; you can redistribute it and/or * 6 * modify it under the terms of the GNU General Public License as * 7 * published by the Free Software Foundation; either version 2 of * 8 * the License, or (at your option) any later version. * 9 * * 10 * This program is distributed in the hope that it will be useful, * 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 * GNU General Public License for more details. * 14 * * 15 * You should have received a copy of the GNU General Public License* 16 * along with this program; if not, contact: * 17 * * 18 * Free Software Foundation Voice: +1-617-542-5942 * 19 * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * 20 * Boston, MA 02111-1307, USA gnu@gnu.org * 21 * * 22 \********************************************************************/ 23 /**@file index.php Displays the portal page 24 * @author Copyright (C) 2004 Benoit Gr�goire et Philippe April 25 */ 26 27 define('BASEPATH', '../'); 27 28 require_once BASEPATH.'include/common.php'; 28 29 require_once BASEPATH.'include/common_interface.php'; 29 30 require_once BASEPATH.'classes/Node.php'; 31 require_once BASEPATH.'classes/MainUI.php'; 30 32 31 if (CONF_USE_CRON_FOR_DB_CLEANUP == false) { 32 garbage_collect(); 33 if (CONF_USE_CRON_FOR_DB_CLEANUP == false) 34 { 35 garbage_collect(); 33 36 } 34 $node = Node ::getObject($_REQUEST['gw_id']);37 $node = Node :: getObject($_REQUEST['gw_id']); 35 38 36 if ($node==null) { 37 $smarty->display("templates/message_unknown_hotspot.html"); 38 exit; 39 } 40 $node_id=$node->getId(); 41 $portal_template = $node_id . ".html"; 42 43 if ($node == null) { 44 $smarty->assign("gw_id", $_REQUEST['gw_id']); 45 $smarty->display("templates/message_unknown_hotspot.html"); 46 exit; 39 if ($node == null) 40 { 41 $smarty->assign("gw_id", $_REQUEST['gw_id']); 42 $smarty->display("templates/message_unknown_hotspot.html"); 43 exit; 47 44 } 48 45 49 Node::setCurrentNode($node); 46 $node_id = $node->getId(); 47 $portal_template = $node_id.".html"; 48 Node :: setCurrentNode($node); 50 49 51 $smarty->assign('hotspot_name', $node->getName()); 52 $node_name= $node->getName(); 50 $ui = new MainUI(); 51 if (isset ($session)) 52 { 53 $smarty->assign("original_url_requested", $session->get(SESS_ORIGINAL_URL_VAR)); 54 } 53 55 54 /* Find out who is online */ 55 $smarty->assign("online_users", $node->getOnlineUsers()); 56 $tool_html = ''; 57 $tool_html .= "<h1>At this Hotspot</h1>"."\n"; 58 $tool_html .= '<p class="indent">'."\n"; 59 $tool_html .= "Local content..."."\n"; 60 $tool_html .= "</p>"."\n"; 56 61 62 $tool_html .= "<h1>Users Online</h1>"."\n"; 63 $tool_html .= '<p class="indent">'."\n"; 64 $current_node = Node :: getCurrentNode(); 65 if ($current_node != null) 66 { 67 $current_node_id = $current_node->getId(); 68 $online_users = $current_node->getOnlineUsers(); 69 $num_online_users = count($online_users); 70 if ($num_online_users > 0) 71 { 72 $tool_html .= $num_online_users.' '._("other users online at this hotspot..."); 73 } 74 else 75 { 76 $tool_html .= _("Nobody is online at this hotspot..."); 77 } 78 } 79 else 80 { 81 $current_node_id = null; 82 $tool_html .= _("You are not currently at a hotspot..."); 83 } 84 $tool_html .= "</p>"."\n"; 57 85 58 if (isset($session)) { 59 $smarty->assign("original_url_requested", $session->get(SESS_ORIGINAL_URL_VAR)); 60 } 61 $hotspot_network_name=HOTSPOT_NETWORK_NAME; 62 $hotspot_network_url=HOTSPOT_NETWORK_URL; 63 $network_logo_url=COMMON_CONTENT_URL.NETWORK_LOGO_NAME; 64 $network_logo_banner_url=COMMON_CONTENT_URL.NETWORK_LOGO_BANNER_NAME; 86 $tool_html .= '<p class="indent">'."\n"; 65 87 66 $hotspot_logo_url= find_local_content_url(HOTSPOT_LOGO_NAME); 67 $hotspot_logo_banner_url=find_local_content_url(HOTSPOT_LOGO_BANNER_NAME); 88 $tool_html .= "<a href='content.php?gw_id={$current_node_id}' target='_blank.right'><img src='/images/start.gif'></a>"."\n"; 89 $tool_html .= "</p>"."\n"; 90 $ui->setToolContent($tool_html); 68 91 92 $hotspot_network_name = HOTSPOT_NETWORK_NAME; 93 $hotspot_network_url = HOTSPOT_NETWORK_URL; 94 $network_logo_url = COMMON_CONTENT_URL.NETWORK_LOGO_NAME; 95 $network_logo_banner_url = COMMON_CONTENT_URL.NETWORK_LOGO_BANNER_NAME; 69 96 70 $smarty->display(DEFAULT_CONTENT_SMARTY_PATH."header.html"); 71 $html=''; 97 $hotspot_logo_url = find_local_content_url(HOTSPOT_LOGO_NAME); 98 $hotspot_logo_banner_url = find_local_content_url(HOTSPOT_LOGO_BANNER_NAME); 99 100 $html = ''; 72 101 $html .= "<div id='portal_container'>\n"; 73 102 … … 76 105 $html .= "<a href='{$hotspot_network_url}'><img class='portal_section_logo' src='{$network_logo_banner_url}' alt='{$hotspot_network_name} logo' border='0'></a>\n"; 77 106 $html .= "Content from \"<a href='{$hotspot_network_url}'>{$hotspot_network_name}</a>\"\n"; 78 $contents = Network ::getCurrentNetwork()->getAllContent();107 $contents = Network :: getCurrentNetwork()->getAllContent(); 79 108 foreach ($contents as $content) 80 109 { … … 86 115 $html .= "<div class='portal_node_section'>\n"; 87 116 $html .= "<img class='portal_section_logo' src='{$hotspot_logo_url}' alt=''>\n"; 88 $html .= "Content from \"<a href='{$hotspot_logo_url}'>{$node_name}</a>\"\n"; 117 $html .= "Content from "; 118 $node_homepage = $node->getHomePageURL(); 119 if(!empty($node_homepage)) 120 { 121 $html .= "<a href='$node_homepage'>"; 122 } 123 $html .= $node->getName(); 124 125 if(!empty($node_homepage)) 126 { 127 $html .= "</a>\n"; 128 } 89 129 $contents = $node->getAllContent(); 90 130 foreach ($contents as $content) … … 99 139 $html .= "</div>\n"; 100 140 $html .= "</div>\n"; /* end portal_container */ 101 echo $html; 141 142 $ui->setMainContent($html); 143 $ui->display(); 102 144 /* If we have local content, display it. Otherwise, display default */ 103 145 /*if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.PORTAL_PAGE_NAME)) { … … 109 151 } 110 152 */ 153 ?> 111 154 112 $smarty->display(DEFAULT_CONTENT_SMARTY_PATH."footer.html"); 113 ?> 155 -
trunk/wifidog-auth/wifidog/templates/change_password.html
r530 r566 1 {include file="templates/header_small.html"}2 1 <div id="form"> 3 2 <h3>{"Change my password"|_}</h3> … … 38 37 {/if} 39 38 </div> 40 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/templates/faq.html
r416 r566 1 {include file="templates/header_small.html"} 1 2 2 <div id="form"> 3 3 <h2>{"Frequently Asked Questions"|_}</h3> … … 25 25 </p> 26 26 </div> 27 28 {include file="templates/footer.html"} 27 -
trunk/wifidog-auth/wifidog/templates/generic_error.html
r456 r566 1 {include file="templates/header_small.html"}2 1 3 2 <p> … … 9 8 </p> 10 9 11 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/templates/hotspot_status.html
r437 r566 1 {include file="templates/header.html" title="hotspot list"} 1 2 2 <div id="hotspot_status"> 3 3 <table> -
trunk/wifidog-auth/wifidog/templates/lost_password.html
r530 r566 1 {include file="templates/header_small.html"}2 1 <div id="form"> 3 2 <h3>{"Lost password"|_}</h3> … … 30 29 {/if} 31 30 </div> 32 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/templates/lost_username.html
r530 r566 1 {include file="templates/header_small.html"} 1 2 2 <div id="form"> 3 3 <h3>{"Lost username"|_}</h3> … … 26 26 {/if} 27 27 </div> 28 {include file="templates/footer.html"} 28 -
trunk/wifidog-auth/wifidog/templates/main.html
r349 r566 1 {include file="templates/header.html" title="authentication server"}2 1 <p>{"The network currently has"|_} {$num_valid_users} {"valid users"|_}. {$num_online_users} {"user(s) are currently online"|_}.</p> 3 2 <ul> -
trunk/wifidog-auth/wifidog/templates/message_activate.html
r388 r566 1 {include file="templates/header_small.html"}2 1 3 2 <p> … … 13 12 </p> 14 13 15 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/templates/message_default.html
r388 r566 1 {include file="templates/header_small.html"} 1 2 2 3 3 <p> … … 5 5 </p> 6 6 7 {include file="templates/footer.html"} 7 -
trunk/wifidog-auth/wifidog/templates/message_denied.html
r389 r566 1 {include file="templates/header_small.html"}2 1 3 2 <p> … … 5 4 </p> 6 5 7 {include file="templates/footer.html"} 6 -
trunk/wifidog-auth/wifidog/templates/message_failed_validation.html
r389 r566 1 {include file="templates/header_small.html"}2 1 3 2 <p> … … 9 8 </p> 10 9 11 {include file="templates/footer.html"} 10 -
trunk/wifidog-auth/wifidog/templates/message_unknown_hotspot.html
r404 r566 1 {include file="templates/header_small.html"}2 3 1 <p> 4 2 {if $gw_id} … … 13 11 </p> 14 12 15 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/templates/node_list.html
r405 r566 1 {include file="templates/header.html" title="node list"}2 1 <div id="node_list"> 3 2 <h3>{"Status of all nodes of the"|_} {$smarty.const.HOTSPOT_NETWORK_NAME} {"network"|_}</h3> -
trunk/wifidog-auth/wifidog/templates/resend_validation.html
r530 r566 1 {include file="templates/header_small.html"}2 1 <div id="form"> 3 2 <h3>{"Re-send validation email"|_}</h3> … … 26 25 {/if} 27 26 </div> 28 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/templates/signup.html
r530 r566 1 {include file="templates/header_small.html"}2 1 <div id="form"> 3 2 <h3>{"Register a free account with"|_} {$hotspot_network_name}</h3> … … 38 37 {/if} 39 38 </div> 40 41 {include file="templates/footer.html"} -
trunk/wifidog-auth/wifidog/validate.php
r517 r566 34 34 throw new Exception(_('No user ID specified!')); 35 35 36 $user = User::get UserByID($_REQUEST['user_id']);36 $user = User::getObject($_REQUEST['user_id']); 37 37 38 38 if ($db->EscapeString($_REQUEST['token']) != $user->getValidationToken())
