[Linpha-cvs] SF.net SVN: linpha: [4896] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2008-03-07 15:12:02
|
Revision: 4896 http://linpha.svn.sourceforge.net/linpha/?rev=4896&view=rev Author: fangehrn Date: 2008-03-07 07:11:53 -0800 (Fri, 07 Mar 2008) Log Message: ----------- 2008-03-07 flo * added static login form (for non javascript browsers) Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/modules/module.empty.php trunk/linpha2/templates/default/default.html.php trunk/linpha2/templates/default/menu.html.php Added Paths: ----------- trunk/linpha2/lib/modules/module.login.php trunk/linpha2/templates/default/static.login.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-02-25 23:07:07 UTC (rev 4895) +++ trunk/linpha2/ChangeLog 2008-03-07 15:11:53 UTC (rev 4896) @@ -1,4 +1,7 @@ +2008-03-07 flo + * added static login form (for non javascript browsers) + 2008-02-25 flo * fixed login menu * fixed some menu related bugs Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2008-02-25 23:07:07 UTC (rev 4895) +++ trunk/linpha2/index.php 2008-03-07 15:11:53 UTC (rev 4896) @@ -35,6 +35,9 @@ case 'alb': require_once(LINPHA_DIR.'/lib/modules/module.albums.php'); break; +case 'login': + require_once(LINPHA_DIR.'/lib/modules/module.login.php'); + break; case 'search': require_once(LINPHA_DIR.'/lib/modules/module.search.php'); break; Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2008-02-25 23:07:07 UTC (rev 4895) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2008-03-07 15:11:53 UTC (rev 4896) @@ -296,7 +296,7 @@ */ if( isset($_POST['cmd']) ) { - if($_POST['cmd']=='logout') + if($_POST['cmd']=='logout' && isset($_SESSION['user_name'])) // check for $_SESSION['user_name'] if the user reloads the page after logout { linLog(LOG_TYPE_USER,LOG_NOTICE,'logout','User '.$_SESSION['user_name'].': logged out'); Modified: trunk/linpha2/lib/modules/module.empty.php =================================================================== --- trunk/linpha2/lib/modules/module.empty.php 2008-02-25 23:07:07 UTC (rev 4895) +++ trunk/linpha2/lib/modules/module.empty.php 2008-03-07 15:11:53 UTC (rev 4896) @@ -25,37 +25,8 @@ if(!defined('LINPHA_DIR')) { exit(1); } -echo $_SERVER['PHP_SELF'].'<br />'; +$linpha->template->output['default'] = '<br />'; - -if( isset($_SERVER['PATH_INFO']) ) -{ - echo $_SERVER['PATH_INFO'].'<br />'; - - $name = substr($_SERVER['PATH_INFO'],1); - echo $name.'<br />'; - - $id = LinSql::getIdFromFullFilename($name); - - - echo '<br /><br /><br />'; - - if($id === false) - { - echo 'false!'; - } - else - { - echo 'not false!<br />'; - echo $id.'<br />'; - } -} - - -exit(); - -$linpha->template->output['default'] = ''; - $linpha->template->setModuleName('default'); $linpha->template->URL_full = LINPHA_LINK.'&linCat=empty'; $linpha->template->output['title'] = i18n("empty"); Added: trunk/linpha2/lib/modules/module.login.php =================================================================== --- trunk/linpha2/lib/modules/module.login.php (rev 0) +++ trunk/linpha2/lib/modules/module.login.php 2008-03-07 15:11:53 UTC (rev 4896) @@ -0,0 +1,33 @@ +<?php +/* + * Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> + * Florian Angehrn + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/** + * Filemanager + * @package Modules + */ + +if(!defined('LINPHA_DIR')) { exit(1); } + +$linpha->template->setModuleName('static.login'); +$linpha->template->URL_full = LINPHA_LINK.'&linCat=login'; +$linpha->template->output['title'] = i18n("Login"); +include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); + +?> \ No newline at end of file Modified: trunk/linpha2/templates/default/default.html.php =================================================================== --- trunk/linpha2/templates/default/default.html.php 2008-02-25 23:07:07 UTC (rev 4895) +++ trunk/linpha2/templates/default/default.html.php 2008-03-07 15:11:53 UTC (rev 4896) @@ -7,4 +7,4 @@ ?> </div> -<?php echo $linTpl->divRoundCorners('top','main'); ?> +<?php echo $linTpl->divRoundCorners('bottom','main'); ?> Modified: trunk/linpha2/templates/default/menu.html.php =================================================================== --- trunk/linpha2/templates/default/menu.html.php 2008-02-25 23:07:07 UTC (rev 4895) +++ trunk/linpha2/templates/default/menu.html.php 2008-03-07 15:11:53 UTC (rev 4896) @@ -20,7 +20,7 @@ --> </script> <?php -linSetMenuNoJS(); + linSetMenuNoJS(); } function linSetMenuJS() @@ -37,7 +37,7 @@ 'LINPHA_CLIENT + \'/?linCat=ajax&reloadmenu&linId=\'+IdCurrent, {method: \'post\', '. 'asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;">'; } else { - $html_login .= '<form action="'.$this->URL_full.'" method="POST">'; + $html_login .= '<form action="'.$linTpl->URL_full.'" method="POST">'; } if ($GLOBALS['linpha']->sql->isLoggedIn()) { Added: trunk/linpha2/templates/default/static.login.html.php =================================================================== --- trunk/linpha2/templates/default/static.login.html.php (rev 0) +++ trunk/linpha2/templates/default/static.login.html.php 2008-03-07 15:11:53 UTC (rev 4896) @@ -0,0 +1,45 @@ +<?php echo $linTpl->divRoundCorners('top','main'); ?> + <div id="linDivMain"> +<br /><br /> +<form action="<?php echo $linTpl->URL_full; ?>" method="POST"> +<?php +if ($GLOBALS['linpha']->sql->isLoggedIn()) { + echo i18n("Welcome").' '.$_SESSION['user_name'].' ('.$_SESSION['user_displayname'].')'; + ?> + <br /> + <input type="hidden" name="cmd" value="logout" /> + <input type="submit" name="submit" class="linButton" value="<?php echo i18n("Logout"); ?>" /> + <?php + +} else { + ?> + <br /><label for="linFormUsername" style="display: block; float: left; width: 80px;"> + <?php echo i18n("Username"); ?>: </label> + <input style="width: 105px;" class="linForms" type="text" name="username" value="" id="linFormUsername" /> + + <br /><label for="linFormPassword" style="display: block; float: left; width: 80px;"> + <?php echo i18n("Password"); ?>: </label> + <input style="width: 105px;" class="linForms" type="password" name="password" value="" id="linFormPassword" /> + <br /><br /> + + <?php + if ($GLOBALS['linpha']->sql->config->value['sys_session_autologin']) { + ?> + <label for="linFormCheckboxRemember"> + <input type="checkbox" name="rememberme" value="true" id="linFormCheckboxRemember" /> + <?php echo i18n("Remember Me"); ?> + </label> + <?php + } + ?> + + <input type="hidden" name="cmd" value="login" /> + <input type="submit" name="submit" class="linButton" value="<?php echo i18n("Login"); ?>" /><br /><br /> + <div style="font-size: smaller; border: 0px;"><?php echo i18n("You must have cookies enabled to log in."); ?></div> + <?php +} +?> +</form> +<br /><br /> + </div> +<?php echo $linTpl->divRoundCorners('bottom','main'); ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |