Changeset 1156
- Timestamp:
- 12/31/06 00:25:37 (5 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 3 added
- 13 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/change_password.php (modified) (1 diff)
-
wifidog/classes/Content/IFrameRest/IFrameRest.php (modified) (1 diff)
-
wifidog/classes/Content/SmartyTemplate (added)
-
wifidog/classes/Content/SmartyTemplate/SmartyTemplate.php (added)
-
wifidog/classes/MainUI.php (modified) (4 diffs)
-
wifidog/classes/Node.php (modified) (1 diff)
-
wifidog/classes/SmartyWifidog.php (modified) (4 diffs)
-
wifidog/help.php (modified) (1 diff)
-
wifidog/include/smarty.resource.string.php (added)
-
wifidog/index.php (modified) (1 diff)
-
wifidog/install.php (modified) (4 diffs)
-
wifidog/login/index.php (modified) (1 diff)
-
wifidog/portal/index.php (modified) (4 diffs)
-
wifidog/templates/sites/login.tpl (modified) (1 diff)
-
wifidog/templates/sites/portal.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1154 r1156 1 2006-12-30 Benoit Grégoire <bock@step.polymtl.ca> 2 * install.php: Move path verification to the first page, and make it clearer. Fix PHP warnings. 3 * wifidog/include/smarty.resource.string.php: A smarty resource plugin to parse a smarty template from a string 4 * SmartyTemplate: Very basic but functionnal commit of the new Smarty content type. 5 IMPORTANT NOTE: This will eventually obsolete IFrameRest, which will be removed. 6 * Continue cleaning-up/standardizing Smarty variable usage. 7 8 2006-12-12 Benoit Grégoire <bock@step.polymtl.ca> 9 * Fix all PHP 5.2 compatibility issues I could find. This needs further testing 10 1 11 2006-12-12 Pascal Charest <pascal.charest@gmail.com> 2 12 * install.php: Remove obsolete Phlickr installation references -
trunk/wifidog-auth/wifidog/change_password.php
r1128 r1156 65 65 $user = User::getCurrentUser(); 66 66 if ($user) { 67 User::assignSmartyValues($smarty, $user);68 67 69 68 if ($user->isSuperAdmin() && isset($_REQUEST['username'])) { -
trunk/wifidog-auth/wifidog/classes/Content/IFrameRest/IFrameRest.php
r1090 r1156 110 110 * @return string HTML code for the administration interface 111 111 */ 112 public function getAdminUI( )112 public function getAdminUI($subclass_admin_interface = null, $title=null) 113 113 { 114 114 // Init values -
trunk/wifidog-auth/wifidog/classes/MainUI.php
r1147 r1156 402 402 403 403 // Init ALL smarty values 404 User :: assignSmartyValues($this->smarty, $_currentUser);405 404 $this->smarty->assign('formAction', ""); 406 405 $this->smarty->assign('nodeUI', ""); … … 475 474 $_currentUser = User :: getCurrentUser(); 476 475 477 User :: assignSmartyValues($this->smarty, $_currentUser);478 479 476 $this->smarty->assign('logoutParameters', ""); 480 477 $this->smarty->assign('loginParameters', ""); … … 484 481 $this->smarty->assign('techSupportInformation', ""); 485 482 $this->smarty->assign('shrinkLeftArea', $this->_shrinkLeftArea); 486 487 // Provide Smarty with information about the network488 Network :: assignSmartyValues($this->smarty);489 483 490 484 /* … … 596 590 */ 597 591 598 // Get information about user599 User :: assignSmartyValues($this->smarty);600 601 592 // Provide footer scripts to Smarty 602 593 $this->smarty->assign('footerScripts', $this->_footerScripts); -
trunk/wifidog-auth/wifidog/classes/Node.php
r1148 r1156 1555 1555 } 1556 1556 1557 /** 1558 * Assigns values about node to be processed by the Smarty engine. 1559 * 1560 * @param object $smarty Smarty object 1561 * @param object $net Node object 1562 * 1563 * @return void 1564 * 1565 * @static 1566 * @access public 1567 */ 1568 public static function assignSmartyValues($smarty, $node = null) 1569 { 1570 if (!$node) { 1571 $node = self::getCurrentNode(); 1572 } 1573 1574 // Set network details 1575 $smarty->assign('nodeId', $node ? $node->getId() : ''); 1576 $smarty->assign('nodeName', $node ? $node->getName() : ''); 1577 } 1557 1578 } 1558 1579 -
trunk/wifidog-auth/wifidog/classes/SmartyWifidog.php
r1127 r1156 46 46 */ 47 47 require_once("classes/Locale.php"); 48 require_once("include/smarty.resource.string.php"); 48 49 49 50 // Check if Smarty installed, if not redirect user to web-base installation … … 123 124 */ 124 125 class SmartyWifidog extends Smarty { 125 private static $object;126 126 public static function getObject() { 127 if (self::$object==null) 128 { 129 self::$object=new self(); 130 } 131 return self::$object; 127 return new self(); 132 128 } 133 129 private function __construct() … … 152 148 $this->register_modifier("fsize_format", "smarty_modifier_fsize_format"); 153 149 150 // register the resource name "string" 151 $this->register_resource("string", array("smarty_resource_string_source", 152 "smarty_resource_string_timestamp", 153 "smarty_resource_string_secure", 154 "smarty_resource_string_trusted")); 154 155 $this->caching = false; 155 156 //$this->compile_check = true; 156 $this->assign('app_name','Wifidog auth server');157 158 /* We need this for various forms to redirect properly (language form) */159 $this->assign('request_uri', $_SERVER["REQUEST_URI"]);160 157 161 158 /* Common content */ … … 172 169 173 170 /* Other useful stuff */ 174 $this->assign('userIsAtHotspot', Node::getCurrentRealNode() != null ? true : false); 175 176 $this->assign('currentLocale', Locale::getCurrentLocale()); 171 $this->assign('userIsAtHotspot', Node :: getCurrentRealNode() != null ? true : false); 172 Network::assignSmartyValues($this); 173 Node::assignSmartyValues($this); 174 User::assignSmartyValues($this); 177 175 } 178 176 -
trunk/wifidog-auth/wifidog/help.php
r1127 r1156 53 53 require_once('classes/Network.php'); 54 54 $smarty = SmartyWifidog::getObject(); 55 Network::assignSmartyValues($smarty);56 55 $smarty->assign('read_the_faq', 57 56 sprintf('Read the <a href="%sfaq.php">faq</a> document for more information.', BASE_URL_PATH)); -
trunk/wifidog-auth/wifidog/index.php
r1147 r1156 67 67 // Get information about network 68 68 $network = Network::getCurrentNetwork(); 69 Network::assignSmartyValues($smarty, $network);70 71 // Get information about user72 User::assignSmartyValues($smarty);73 69 74 70 /* -
trunk/wifidog-auth/wifidog/install.php
r1154 r1156 314 314 function execVerbose($command, & $output, & $return_var, $always_show_output = true) { 315 315 print "$command"; 316 $retval = exec($command.' 2>&1', & $output, &$return_var);316 $retval = exec($command.' 2>&1', $output, $return_var); 317 317 if ($return_var != 0) 318 318 print "<p style='color:red'><em>Error:</em> Command did not complete successfully (returned $return_var): <br/>\n"; … … 444 444 $error = 0; 445 445 446 print "<p><em>Installation directory (WIFIDOG_ABS_FILE_PATH)</em>: " . WIFIDOG_ABS_FILE_PATH . "</p>";447 print "<p><em>Note:</em> Please validate that 'Installation directory' value is the right one. If this value is wrong, the PATH automatic detection will not work as properly";448 446 print "<p><em>HTTP daemon UNIX username/group</em>: $process_username/$process_group</p>"; 449 447 # print "<p><em>HTTPD group</em>: $process_group<BR</p>"; … … 1422 1420 $WIFIDOG_VERSION = $configArray['WIFIDOG_VERSION']; 1423 1421 # TODO : Add links to auth-server web documents 1424 print<<<EndHTML1422 print<<<EndHTML 1425 1423 <h1>Welcome to WifiDog Auth-Server installation and configuration script.</h1> 1426 1424 <p>This installation still needs improvement, so please any report bug to the mailing list for better support.<BR/> 1427 1425 The current auth-server version is <em>$WIFIDOG_VERSION</em>.</p> 1428 1426 1429 <p><strong>Before going any further</strong> with this installation you need to have/create a valid user and database.1430 < p>Here is a command line example for PostgreSQL (or use the way you like) :</p>1431 1427 <p><strong>Before going any further</strong> with this installation you need to do the following:\n 1428 <h2>1-Make sure you created a valid user and database.</h2> 1429 <p>If you haven't, here is a command line example for PostgreSQL (or use the way you like) :</p> 1432 1430 <em>Create the PostgreSQL databaser user for WifiDog</em> (createuser and createdb need to be in you PATH) : 1433 1431 <pre> <I>postgres@yourserver $></I> createuser wifidog --pwprompt … … 1438 1436 CREATE USER 1439 1437 </pre> 1440 1441 1438 <em>Create the WifiDog database</em> 1442 1439 <pre> <I>postgres@yourserver $></I> createdb wifidog --encoding=UTF-8 --owner=wifidog 1443 1440 CREATE DATABASE 1444 1441 </pre> 1445 1446 <em>Security</em> : A password is needed to continue with the installation. You need to read the random password in <em>$password_file</em> file. No username needed, only the password. This password is only usefull for the installation, you will never use it in Auth-Server administration pages. 1442 <h2>2-Check that the paths were autodected properly</h2> 1443 EndHTML; 1444 echo "<table>\n"; 1445 echo "<tr><td>Absolute path to the /wifidog directory (WIFIDOG_ABS_FILE_PATH):</td><td>" . WIFIDOG_ABS_FILE_PATH . "</td></tr>\n"; 1446 echo "<tr><td>URL path to reach the /wifidog directory with a web browser (SYSTEM_PATH): </td><td>" . SYSTEM_PATH . "</td></tr>\n"; 1447 echo "<tr><td colspan=2><em>Please verify the two values above.</em> They should be autodectected correctly by wifidog in path_defines_base.php. If there is a bug and they are not, you need to override them in config.php (or find the bug), or your auth server will not work properly. </td></tr></table>\n"; 1448 print<<<EndHTML 1449 <h2>3-Retrieve the install password</h2> 1450 A password is needed to continue with the installation. You need to read the random password in <em>$password_file</em> file. No username needed, only the password. This password is only usefull for the installation, you will never use it in Auth-Server administration pages. 1447 1451 </pre> 1448 1452 -
trunk/wifidog-auth/wifidog/login/index.php
r1135 r1156 242 242 243 243 // Set details about node 244 $smarty->assign('node', $node);245 244 $smarty->assign('gw_address', $gw_address); 246 245 $smarty->assign('gw_port', $gw_port); -
trunk/wifidog-auth/wifidog/portal/index.php
r1147 r1156 135 135 $smarty->assign('sectionMAINCONTENT', false); 136 136 137 // Init ALL smarty values138 $smarty->assign('currentNode', null);139 $smarty->assign('numOnlineUsers', 0);140 $smarty->assign('onlineUsers', array ());141 $smarty->assign('userIsAtHotspot', false);142 $smarty->assign('noUrl', true);143 $smarty->assign('url', "");144 $smarty->assign('currentUrl', "");145 $smarty->assign('accountValidation', false);146 $smarty->assign('validationTime', 20);147 $smarty->assign('hotspotNetworkUrl', "");148 $smarty->assign('hotspotNetworkName', "");149 $smarty->assign('networkLogoBannerUrl', "");150 $smarty->assign('networkContents', false);151 $smarty->assign('networkContentArray', array ());152 $smarty->assign('nodeHomepage', false);153 $smarty->assign('nodeURL', "");154 $smarty->assign('nodeName', "");155 $smarty->assign('nodeContents', false);156 $smarty->assign('nodeContentArray', array ());157 $smarty->assign('userContents', false);158 $smarty->assign('userContentArray', array ());159 160 /*161 * Tool content162 */163 164 // Set section of Smarty template165 $smarty->assign('sectionTOOLCONTENT', true);166 167 // Set details about node168 $smarty->assign('currentNode', $current_node);169 137 170 138 // Set details about onlineusers … … 184 152 185 153 */ 186 $smarty->assign('numOnlineUsers', $num_online_users); 187 154 $smarty->assign('onlineUsers', array ()); 188 155 if ($num_online_users > 0) { 189 156 $smarty->assign('onlineUsers', $online_user_array); … … 192 159 // Check for requested URL and if user is at a hotspot 193 160 $original_url_requested = $session->get(SESS_ORIGINAL_URL_VAR); 194 195 $smarty->assign('userIsAtHotspot', Node :: getCurrentRealNode() != null ? true : false);196 161 197 162 if (empty ($original_url_requested)) { … … 199 164 $smarty->assign('url', "?missing=url"); 200 165 } else { 201 $smarty->assign('noUrl', true);166 $smarty->assign('noUrl', false); 202 167 $smarty->assign('url', $original_url_requested); 203 168 } 204 205 // Assign current request url206 $smarty->assign('currentUrl', CURRENT_REQUEST_URL);207 169 208 170 // Compile HTML code -
trunk/wifidog-auth/wifidog/templates/sites/login.tpl
r1049 r1156 50 50 <form name="login_form" action="{$base_ssl_path}login/index.php" method="post" onsubmit="return validateForm(this);"> 51 51 <input type="hidden" name="form_request" value="login"> 52 {if $ node!= null}52 {if $gw_address != null} 53 53 <input type="hidden" name="gw_address" value="{$gw_address}"> 54 {/if} 55 {if $gw_port != null} 54 56 <input type="hidden" name="gw_port" value="{$gw_port}"> 57 {/if} 58 {if $gw_id != null} 55 59 <input type="hidden" name="gw_id" value="{$gw_id}"> 56 60 {/if} -
trunk/wifidog-auth/wifidog/templates/sites/portal.tpl
r1041 r1156 49 49 50 50 <p class="indent"> 51 {if $ currentNode!= null}52 {if ($n umOnlineUsers > 0)}53 {if ($n umOnlineUsers == 1)}51 {if $nodeId != null} 52 {if ($networkNumOnlineUsers > 0)} 53 {if ($networkNumOnlineUsers == 1)} 54 54 1 {"user is online at this hotspot"|_} 55 55 {else} 56 {$n umOnlineUsers} {"users are online at this hotspot"|_}56 {$networkNumOnlineUsers} {"users are online at this hotspot"|_} 57 57 {/if} 58 58
