Skip to content

Commit

Permalink
inputparameter related
Browse files Browse the repository at this point in the history
  • Loading branch information
schlundus committed Jun 4, 2009
1 parent ed75862 commit 42ac687
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 42 deletions.
20 changes: 6 additions & 14 deletions firstLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*
* Filename $RCSfile: firstLogin.php,v $
*
* @version $Revision: 1.31 $
* @modified $Date: 2009/05/20 21:38:18 $ $Author: schlundus $
* @version $Revision: 1.32 $
* @modified $Date: 2009/06/04 19:53:27 $ $Author: schlundus $
*
*/
require_once('config.inc.php');
Expand Down Expand Up @@ -67,25 +67,17 @@
function init_args()
{
$iParams = array(
"editUser" => array(tlInputParameter::STRING_N,0,1),
"loginName" => array(tlInputParameter::STRING_N,0,30),
"bEditUser" => array(tlInputParameter::STRING_N,0,1),
"login" => array(tlInputParameter::STRING_N,0,30),
"password" => array(tlInputParameter::STRING_N,0,32),
"password2" => array(tlInputParameter::STRING_N,0,32),
"first" => array(tlInputParameter::STRING_N,0,30),
"last" => array(tlInputParameter::STRING_N,0,30),
"email" => array(tlInputParameter::STRING_N,0,100),
);
$pParams = P_PARAMS($iParams);

$args = new stdClass();
$args->bEditUser = $pParams["editUser"];
$args->login = $pParams["loginName"];
$args->password = $pParams["password"];
$args->password2 = $pParams["password2"];
$args->first = $pParams["first"];
$args->last = $pParams["last"];
$args->email = $pParams["email"];

$pParams = P_PARAMS($iParams,$args);

return $args;
}
?>
8 changes: 4 additions & 4 deletions gui/templates/loginFirst.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{*
TestLink Open Source Project - http://testlink.sourceforge.net/
$Id: loginFirst.tpl,v 1.15 2009/01/13 19:34:01 schlundus Exp $
$Id: loginFirst.tpl,v 1.16 2009/06/04 19:53:27 schlundus Exp $
Purpose: smarty template - first login
*}
{include file="inc_head.tpl" title="TestLink - New Account" openHead='yes'}
Expand All @@ -16,7 +16,7 @@ window.onload=function(){
Nifty("div#login_div","big");
Nifty("div.messages","normal");
// set focus on login text box
focusInputField('loginName');
focusInputField('login');
}
</script>
{/literal}
Expand All @@ -32,7 +32,7 @@ window.onload=function(){
<form method="post" action="firstLogin.php">

<p class="label">{$labels.login_name}<br />
<input type="text" name="loginName" id="loginName"
<input type="text" name="login" id="login"
size="{#LOGIN_SIZE#}" maxlength="{#LOGIN_MAXLEN#}" value="{$login|escape}"/></p>

{if $external_password_mgmt eq 0}
Expand All @@ -53,7 +53,7 @@ window.onload=function(){
<p>{$labels.password_mgmt_is_external}<p>
{/if}

<br /><input type="submit" name="editUser" value="{$labels.btn_add_user_data}" />
<br /><input type="submit" name="bEditUser" value="{$labels.btn_add_user_data}" />
</form>
<hr />
<p><a href="login.php">{$labels.link_back_to_login}</a></p>
Expand Down
5 changes: 3 additions & 2 deletions gui/templates/usermanagement/usersView.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{*
Testlink Open Source Project - http://testlink.sourceforge.net/
$Id: usersView.tpl,v 1.15 2009/06/03 19:51:45 schlundus Exp $
$Id: usersView.tpl,v 1.16 2009/06/04 19:53:27 schlundus Exp $
Purpose: smarty template - users overview
*}
Expand Down Expand Up @@ -77,10 +77,11 @@ Purpose: smarty template - users overview
{section name=row loop=$users start=0}
{assign var="user" value="$users[row]"}
{assign var="userLocale" value=$user->locale}
{assign var="r_n" value=$user->globalRole->name}
{assign var="r_d" value=$user->globalRole->getDisplayName()}
{assign var="userID" value=$user->dbID}

<tr {if $role_colour[$r_d] neq ''} style="background-color: {$role_colour[$r_d]};" {/if}>
<tr {if $role_colour[$r_n] neq ''} style="background-color: {$role_colour[$r_n]};" {/if}>
<td><a href="{$editUserAction}{$user->dbID}">
{$user->login|escape}
{if $gsmarty_gui->show_icon_edit}
Expand Down
9 changes: 5 additions & 4 deletions lib/functions/role.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*
* Filename $RCSfile: role.class.php,v $
*
* @version $Revision: 1.25 $
* @modified $Date: 2009/06/04 19:22:01 $ $Author: schlundus $
* @version $Revision: 1.26 $
* @modified $Date: 2009/06/04 19:53:27 $ $Author: schlundus $
*
* rev:
* 20090221 - franciscom - hasRight() - BUG - function parameter name crashes with local variable
Expand Down Expand Up @@ -185,7 +185,8 @@ public function getDisplayName()
$displayName = $this->name;
if ($displayName{0} == "<")
{
$displayName = lang_get($displayName);
$roleName = str_replace(" ","_",substr($displayName,1,-1));
$displayName = "<".lang_get($roleName).">";
}
return $displayName;
}
Expand Down Expand Up @@ -418,7 +419,7 @@ static public function getAll(&$db,$whereClause = null,$column = null,
$roles = tlDBObject::createObjectsFromDBbySQL($db,$query,'id',__CLASS__,true,$detailLevel);

$inheritedRole = new tlRole(TL_ROLES_INHERITED);
$inheritedRole->name = lang_get('inherited_role');
$inheritedRole->name = "<inherited>";
$roles[TL_ROLES_INHERITED] = $inheritedRole;

return $roles;
Expand Down
6 changes: 3 additions & 3 deletions lib/usermanagement/usersView.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*
* Filename $RCSfile: usersView.php,v $
*
* @version $Revision: 1.26 $
* @modified $Date: 2009/04/27 19:35:12 $ - $Author: schlundus $
* @version $Revision: 1.27 $
* @modified $Date: 2009/06/04 19:53:27 $ - $Author: schlundus $
*
* shows all users
*
Expand Down Expand Up @@ -178,7 +178,7 @@ function getRoleColourCfg(&$dbHandler)
unset($roles[TL_ROLES_UNDEFINED]);
foreach($roles as $roleObj)
{
if(!isset($role_colour[$roleObj->name]))
if(!isset($role_colour[$roleObj->name]))
{
$role_colour[$roleObj->name] = '';
}
Expand Down
7 changes: 4 additions & 3 deletions locale/de_DE/strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* This script is distributed under the GNU General Public License 2 or later.
*
* Filename $RCSfile: strings.txt,v $
* @version $Revision: 1.117 $
* @modified $Date: 2009/06/03 19:51:46 $ by $Author: schlundus $
* @version $Revision: 1.118 $
* @modified $Date: 2009/06/04 19:53:27 $ by $Author: schlundus $
*
* @copyright Copyright (c) 2008, TestLink community
* @author Francisco Mancardi
Expand Down Expand Up @@ -1639,7 +1639,8 @@ $TLS_error_role_no_rights = "Sie k
$TLS_error_role_no_rolename = "Sie m�ssen der Rolle einen Namen vergeben!";
$TLS_inherited_role = "<geerbt>";
$TLS_mgt_testplan_create = "Erstellen von Testpl�nen";

$TLS_inherited = "geerbt";
$TLS_no_rights = "keine Rechte";


// lib/functions/testproject.class.php
Expand Down
7 changes: 4 additions & 3 deletions locale/en_GB/strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* This script is distributed under the GNU General Public License 2 or later.
*
* Filename $RCSfile: strings.txt,v $
* @version $Revision: 1.448 $
* @modified $Date: 2009/06/03 19:51:46 $ by $Author: schlundus $
* @version $Revision: 1.449 $
* @modified $Date: 2009/06/04 19:53:27 $ by $Author: schlundus $
*
* @copyright Copyright (c) 2003-9, TestLink community
* @author Francisco Mancardi, Andreas Morsing, Martin Havlat
Expand Down Expand Up @@ -1750,7 +1750,8 @@ $TLS_error_role_no_rights = "You cannot save roles without any rights!";
$TLS_error_role_no_rolename = "You must enter a name for the role!";
$TLS_inherited_role = "<inherited>";
$TLS_mgt_testplan_create = "Test Plan create/edit";

$TLS_inherited = "inherited";
$TLS_no_rights = "no rights";


// ----- lib/functions/testproject.class.php -----
Expand Down
21 changes: 14 additions & 7 deletions logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,29 @@
*
* Filename $RCSfile: logout.php,v $
*
* @version $Revision: 1.15 $
* @modified $Date: 2008/10/12 08:11:56 $
* @version $Revision: 1.16 $
* @modified $Date: 2009/06/04 19:53:27 $
**/
require_once('config.inc.php');
require_once('common.php');
testlinkInitPage($db);

$userID = $_SESSION['userID'] ? $_SESSION['userID'] : null;
if ($userID)
$args = init_args();
if ($args->userID)
{
$userName = $_SESSION['currentUser']->getDisplayName();
logAuditEvent(TLS("audit_user_logout",$userName),"LOGOUT",$userID,"users");
logAuditEvent(TLS("audit_user_logout",$args->userName),"LOGOUT",$args->userID,"users");
}
session_unset();
session_destroy();

redirect("login.php");
exit();

function init_args()
{
$args = new stdClass();
$args->userID = isset($_SESSION['userID']) ? $_SESSION['userID'] : null;
$args->userName = $args->userID ? $_SESSION['currentUser']->getDisplayName() : "";

return $args;
}
?>
5 changes: 3 additions & 2 deletions lostPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*
* Filename $RCSfile: lostPassword.php,v $
*
* @version $Revision: 1.36 $
* @modified $Date: 2009/05/13 16:31:39 $ $Author: schlundus $
* @version $Revision: 1.37 $
* @modified $Date: 2009/06/04 19:53:27 $ $Author: schlundus $
*
**/
require_once('config.inc.php');
Expand Down Expand Up @@ -70,6 +70,7 @@
function init_args()
{
$iParams = array("login" => array(tlInputParameter::STRING_N,0,30));

$args = new stdClass();
$pParams = P_PARAMS($iParams,$args); // WHY TO ASSIGN A VALUE THAT IS NEVER USED ?????
Expand Down

0 comments on commit 42ac687

Please sign in to comment.