Fix variable naming of preferences/account related form variables to match our coding standards
This commit is contained in:
41
account.php
41
account.php
@@ -83,29 +83,29 @@ function cmd_do_new()
|
|||||||
{
|
{
|
||||||
$aClean = array(); //array of filtered user input
|
$aClean = array(); //array of filtered user input
|
||||||
|
|
||||||
$aClean['ext_email'] = makeSafe($_POST['ext_email']);
|
$aClean['sUserEmail'] = makeSafe($_POST['sUserEmail']);
|
||||||
$aClean['ext_password'] = makeSafe($_POST['ext_password']);
|
$aClean['sUserPassword'] = makeSafe($_POST['sUserPassword']);
|
||||||
$aClean['ext_password2'] = makeSafe($_POST['ext_password2']);
|
$aClean['sUserPassword2'] = makeSafe($_POST['sUserPassword2']);
|
||||||
$aClean['CVSrelease'] = makeSafe($_POST['CVSrelease']);
|
$aClean['sWineRelease'] = makeSafe($_POST['sWineRelease']);
|
||||||
$aClean['ext_realname']= makeSafe($_POST['ext_realname']);
|
$aClean['sUserRealname']= makeSafe($_POST['sUserRealname']);
|
||||||
|
|
||||||
if(!ereg("^.+@.+\\..+$", $aClean['ext_email']))
|
if(!ereg("^.+@.+\\..+$", $aClean['sUserEmail']))
|
||||||
{
|
{
|
||||||
$aClean['ext_email'] = "";
|
$aClean['sUserEmail'] = "";
|
||||||
retry("new", "Invalid email address");
|
retry("new", "Invalid email address");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(strlen($aClean['ext_password']) < 5)
|
if(strlen($aClean['sUserPassword']) < 5)
|
||||||
{
|
{
|
||||||
retry("new", "Password must be at least 5 characters");
|
retry("new", "Password must be at least 5 characters");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if($aClean['ext_password'] != $aClean['ext_password2'])
|
if($aClean['sUserPassword'] != $aClean['sUserPassword2'])
|
||||||
{
|
{
|
||||||
retry("new", "Passwords don't match");
|
retry("new", "Passwords don't match");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(empty($aClean['ext_realname']))
|
if(empty($aClean['sUserRealname']))
|
||||||
{
|
{
|
||||||
retry("new", "You don't have a Real name?");
|
retry("new", "You don't have a Real name?");
|
||||||
return;
|
return;
|
||||||
@@ -113,14 +113,15 @@ function cmd_do_new()
|
|||||||
|
|
||||||
$oUser = new User();
|
$oUser = new User();
|
||||||
|
|
||||||
$iResult = $oUser->create($aClean['ext_email'], $aClean['ext_password'], $aClean['ext_realname'], $aClean['CVSrelease'] );
|
$iResult = $oUser->create($aClean['sUserEmail'], $aClean['sUserPassword'],
|
||||||
|
$aClean['sUserRealname'], $aClean['sWineRelease'] );
|
||||||
|
|
||||||
if($iResult == SUCCESS)
|
if($iResult == SUCCESS)
|
||||||
{
|
{
|
||||||
/* if we can log the user in, log them in automatically */
|
/* if we can log the user in, log them in automatically */
|
||||||
$oUser->login($aClean['ext_email'], $aClean['ext_password']);
|
$oUser->login($aClean['sUserEmail'], $aClean['sUserPassword']);
|
||||||
|
|
||||||
addmsg("Account created! (".$aClean['ext_email'].")", "green");
|
addmsg("Account created! (".$aClean['sUserEmail'].")", "green");
|
||||||
redirect(apidb_fullurl());
|
redirect(apidb_fullurl());
|
||||||
}
|
}
|
||||||
else if($iResult == USER_CREATE_EXISTS)
|
else if($iResult == USER_CREATE_EXISTS)
|
||||||
@@ -146,11 +147,11 @@ function cmd_send_passwd()
|
|||||||
{
|
{
|
||||||
$aClean = array(); //array of filtered user input
|
$aClean = array(); //array of filtered user input
|
||||||
|
|
||||||
$aClean['ext_email'] = makeSafe($_POST['ext_email']);
|
$aClean['sUserEmail'] = makeSafe($_POST['sUserEmail']);
|
||||||
|
|
||||||
/* if the user didn't enter any email address we should */
|
/* if the user didn't enter any email address we should */
|
||||||
/* ask them to */
|
/* ask them to */
|
||||||
if($aClean['ext_email'] == "")
|
if($aClean['sUserEmail'] == "")
|
||||||
{
|
{
|
||||||
addmsg("Please enter your email address in the 'E-mail' field and re-request a new password",
|
addmsg("Please enter your email address in the 'E-mail' field and re-request a new password",
|
||||||
"green");
|
"green");
|
||||||
@@ -160,7 +161,7 @@ function cmd_send_passwd()
|
|||||||
$shNote = '(<b>Note</b>: accounts for <b>appdb</b>.winehq.org and <b>bugs</b>.winehq.org '
|
$shNote = '(<b>Note</b>: accounts for <b>appdb</b>.winehq.org and <b>bugs</b>.winehq.org '
|
||||||
.'are separated, so You might need to <b>create second</b> account for appdb.)';
|
.'are separated, so You might need to <b>create second</b> account for appdb.)';
|
||||||
|
|
||||||
$iUserId = User::exists($aClean['ext_email']);
|
$iUserId = User::exists($aClean['sUserEmail']);
|
||||||
$sPasswd = User::generate_passwd();
|
$sPasswd = User::generate_passwd();
|
||||||
$oUser = new User($iUserId);
|
$oUser = new User($iUserId);
|
||||||
if ($iUserId)
|
if ($iUserId)
|
||||||
@@ -190,7 +191,7 @@ function cmd_send_passwd()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
addmsg("Sorry, that user (".$aClean['ext_email'].") does not exist.<br><br>"
|
addmsg("Sorry, that user (".$aClean['sUserEmail'].") does not exist.<br><br>"
|
||||||
.$shNote, "red");
|
.$shNote, "red");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,11 +205,11 @@ function cmd_do_login()
|
|||||||
{
|
{
|
||||||
$aClean = array(); //array of filtered user input
|
$aClean = array(); //array of filtered user input
|
||||||
|
|
||||||
$aClean['ext_email'] = makeSafe($_POST['ext_email']);
|
$aClean['sUserEmail'] = makeSafe($_POST['sUserEmail']);
|
||||||
$aClean['ext_password'] = makeSafe($_POST['ext_password']);
|
$aClean['sUserPassword'] = makeSafe($_POST['sUserPassword']);
|
||||||
|
|
||||||
$oUser = new User();
|
$oUser = new User();
|
||||||
$iResult = $oUser->login($aClean['ext_email'], $aClean['ext_password']);
|
$iResult = $oUser->login($aClean['sUserEmail'], $aClean['sUserPassword']);
|
||||||
|
|
||||||
if($iResult == SUCCESS)
|
if($iResult == SUCCESS)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,19 +12,19 @@ $aClean['userId'] = makeSafe($_REQUEST['userId']);
|
|||||||
<!-- start of edit account form -->
|
<!-- start of edit account form -->
|
||||||
<tr>
|
<tr>
|
||||||
<td> Email Address </td>
|
<td> Email Address </td>
|
||||||
<td> <input type="text" name="ext_email" value="<?php echo $ext_email; ?>"> </td>
|
<td> <input type="text" name="sUserEmail" value="<?php echo $sUserEmail; ?>"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> Password </td>
|
<td> Password </td>
|
||||||
<td> <input type="password" name="ext_password"> </td>
|
<td> <input type="password" name="sUserPassword"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> Password (again) </td>
|
<td> Password (again) </td>
|
||||||
<td> <input type="password" name="ext_password2"> </td>
|
<td> <input type="password" name="sUserPassword2"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> Real Name </td>
|
<td> Real Name </td>
|
||||||
<td> <input type="text" name="ext_realname" value="<?php echo $ext_realname; ?>"> </td>
|
<td> <input type="text" name="sUserRealname" value="<?php echo $sUserRealname; ?>"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
// if we manage another user we can give him administrator rights
|
// if we manage another user we can give him administrator rights
|
||||||
@@ -33,7 +33,7 @@ if($oUser->iUserId == $aClean['userId'])
|
|||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td> Administrator </td>
|
<td> Administrator </td>
|
||||||
<td> <input type="checkbox" name="ext_hasadmin" "<?php echo $ext_hasadmin; ?>" value="on"> </td>
|
<td> <input type="checkbox" name="sHasAdmin" "<?php echo $sHasAdmin; ?>" value="on"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ require_once(BASE."include/util.php");
|
|||||||
|
|
||||||
$aClean = array(); //array of filtered user input
|
$aClean = array(); //array of filtered user input
|
||||||
|
|
||||||
$aClean['ext_email'] = makeSafe($_POST['ext_email']);
|
$aClean['sUserEmail'] = makeSafe($_POST['sUserEmail']);
|
||||||
|
|
||||||
/**************/
|
/**************/
|
||||||
/* Login Form */
|
/* Login Form */
|
||||||
@@ -25,11 +25,11 @@ function cmd_send_passwd() {
|
|||||||
<table border="0" width="100%" cellspacing=0 cellpadding="10">
|
<table border="0" width="100%" cellspacing=0 cellpadding="10">
|
||||||
<tr>
|
<tr>
|
||||||
<td class=color1> E-mail </td>
|
<td class=color1> E-mail </td>
|
||||||
<td class=color0> <input type="text" name="ext_email" value='<?php if(!empty($aClean['ext_email'])) echo $aClean['ext_email']?>'> </td>
|
<td class=color0> <input type="text" name="sUserEmail" value='<?php if(!empty($aClean['sUserEmail'])) echo $aClean['sUserEmail']?>'> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class=color1> Password </td>
|
<td class=color1> Password </td>
|
||||||
<td class=color0> <input type="password" name="ext_password"> </td>
|
<td class=color0> <input type="password" name="sUserPassword"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 align=center class=color3>
|
<td colspan=2 align=center class=color3>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ require_once(BASE."include/util.php");
|
|||||||
|
|
||||||
$aClean = array(); //array of filtered user input
|
$aClean = array(); //array of filtered user input
|
||||||
|
|
||||||
$aClean['ext_email'] = makeSafe($_POST['ext_email']);
|
$aClean['sUserEmail'] = makeSafe($_POST['sUserEmail']);
|
||||||
$aClean['ext_realname'] = makeSafe($_POST['realname']);
|
$aClean['sUserRealname'] = makeSafe($_POST['realname']);
|
||||||
|
|
||||||
|
|
||||||
/********************/
|
/********************/
|
||||||
@@ -19,24 +19,24 @@ echo html_frame_start("Create New Application DB Account","400","",0)
|
|||||||
<table border=0 width="100%" cellspacing=0 cellpadding=20>
|
<table border=0 width="100%" cellspacing=0 cellpadding=20>
|
||||||
<tr>
|
<tr>
|
||||||
<td class=color1> E-mail </td>
|
<td class=color1> E-mail </td>
|
||||||
<td class=color0> <input type="text" name="ext_email" value='<?php if(!empty($aClean['ext_email'])) echo $aClean['ext_email']?>'> </td>
|
<td class=color0> <input type="text" name="sUserEmail" value='<?php if(!empty($aClean['sUserEmail'])) echo $aClean['sUserEmail']?>'> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class=color1> Password </td>
|
<td class=color1> Password </td>
|
||||||
<td class=color0> <input type="password" name="ext_password"> </td>
|
<td class=color0> <input type="password" name="sUserPassword"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class=color1> Password (again) </td>
|
<td class=color1> Password (again) </td>
|
||||||
<td class=color0> <input type="password" name="ext_password2"> </td>
|
<td class=color0> <input type="password" name="sUserPassword2"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class=color1> Real Name </td>
|
<td class=color1> Real Name </td>
|
||||||
<td class=color0> <input type="text" name="ext_realname" value='<?php if(!empty($aClean['ext_realname'])) echo $aClean['ext_realname']?>'> </td>
|
<td class=color0> <input type="text" name="sUserRealname" value='<?php if(!empty($aClean['sUserRealname'])) echo $aClean['sUserRealname']?>'> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo "<tr><td class=color1> Wine version </td><td class=color0>";
|
echo "<tr><td class=color1> Wine version </td><td class=color0>";
|
||||||
make_bugzilla_version_list("CVSrelease", $CVSrelease);
|
make_bugzilla_version_list("sWineRelease", $aClean['sWineRelease']);
|
||||||
echo "</td></tr>";
|
echo "</td></tr>";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ $aClean = array(); //array of filtered user input
|
|||||||
$aClean['userId'] = makeSafe($_REQUEST['userId']);
|
$aClean['userId'] = makeSafe($_REQUEST['userId']);
|
||||||
$aClean['iLimit'] = makeSafe($_REQUEST['iLimit']);
|
$aClean['iLimit'] = makeSafe($_REQUEST['iLimit']);
|
||||||
$aClean['sOrderBy'] = makeSafe($_REQUEST['sOrderBy']);
|
$aClean['sOrderBy'] = makeSafe($_REQUEST['sOrderBy']);
|
||||||
$aClean['ext_password'] = makeSafe($_REQUEST['ext_password']);
|
$aClean['sUserPassword'] = makeSafe($_REQUEST['sUserPassword']);
|
||||||
$aClean['ext_password2'] = makeSafe($_REQUEST['ext_password2']);
|
$aClean['sUserPassword2'] = makeSafe($_REQUEST['sUserPassword2']);
|
||||||
$aClean['ext_email'] = makeSafe($_REQUEST['ext_email']);
|
$aClean['sUserEmail'] = makeSafe($_REQUEST['sUserEmail']);
|
||||||
$aClean['ext_realname'] = makeSafe($_REQUEST['ext_realname']);
|
$aClean['sUserRealname'] = makeSafe($_REQUEST['sUserRealname']);
|
||||||
$aClean['CVSrelease'] = makeSafe($_REQUEST['CVSrelease']);
|
$aClean['sWineRelease'] = makeSafe($_REQUEST['sWineRelease']);
|
||||||
$aClean['ext_hasadmin'] = makeSafe($_POST['ext_hasadmin']);
|
$aClean['sHasAdmin'] = makeSafe($_POST['sHasAdmin']);
|
||||||
|
|
||||||
/* filter all of the preferences */
|
/* filter all of the preferences */
|
||||||
while(list($key, $value) = each($_REQUEST))
|
while(list($key, $value) = each($_REQUEST))
|
||||||
@@ -85,18 +85,18 @@ function show_user_fields()
|
|||||||
{
|
{
|
||||||
global $oUser;
|
global $oUser;
|
||||||
|
|
||||||
$ext_realname = $oUser->sRealname;
|
$sUserRealname = $oUser->sRealname;
|
||||||
$ext_email = $oUser->sEmail;
|
$sUserEmail = $oUser->sEmail;
|
||||||
$CVSrelease = $oUser->sWineRelease;
|
$sWineRelease = $oUser->sWineRelease;
|
||||||
if($oUser->hasPriv("admin"))
|
if($oUser->hasPriv("admin"))
|
||||||
$ext_hasadmin = 'checked="true"';
|
$sHasAdmin = 'checked="true"';
|
||||||
else
|
else
|
||||||
$ext_hasadmin = "";
|
$sHasAdmin = "";
|
||||||
|
|
||||||
include(BASE."include/form_edit.php");
|
include(BASE."include/form_edit.php");
|
||||||
|
|
||||||
echo "<tr><td> Wine version </td><td>";
|
echo "<tr><td> Wine version </td><td>";
|
||||||
make_bugzilla_version_list("CVSrelease", $CVSrelease);
|
make_bugzilla_version_list("sWineRelease", $sWineRelease);
|
||||||
echo "</td></tr>";
|
echo "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,19 +112,19 @@ if($_POST)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make sure the user enters the same password twice */
|
/* make sure the user enters the same password twice */
|
||||||
if ($aClean['ext_password'] == $aClean['ext_password2'])
|
if ($aClean['sUserPassword'] == $aClean['sUserPassword2'])
|
||||||
{
|
{
|
||||||
$str_passwd = $aClean['ext_password'];
|
$str_passwd = $aClean['sUserPassword'];
|
||||||
}
|
}
|
||||||
else if ($aClean['ext_password'])
|
else if ($aClean['sUserPassword'])
|
||||||
{
|
{
|
||||||
addmsg("The Passwords you entered did not match.", "red");
|
addmsg("The Passwords you entered did not match.", "red");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update user data fields */
|
/* update user data fields */
|
||||||
$oUser->sEmail = $aClean['ext_email'];
|
$oUser->sEmail = $aClean['sUserEmail'];
|
||||||
$oUser->sRealname = $aClean['ext_realname'];
|
$oUser->sRealname = $aClean['sUserRealname'];
|
||||||
$oUser->sWineRelease = $aClean['CVSrelease'];
|
$oUser->sWineRelease = $aClean['sWineRelease'];
|
||||||
|
|
||||||
/* if the password was empty in both cases then skip updating the users password */
|
/* if the password was empty in both cases then skip updating the users password */
|
||||||
if($str_passwd != "")
|
if($str_passwd != "")
|
||||||
@@ -139,7 +139,7 @@ if($_POST)
|
|||||||
// we were managing an user, let's go back to the admin after updating tha admin status
|
// we were managing an user, let's go back to the admin after updating tha admin status
|
||||||
if($oUser->iUserId == $aClean['userId'] && $_SESSION['current']->hasPriv("admin"))
|
if($oUser->iUserId == $aClean['userId'] && $_SESSION['current']->hasPriv("admin"))
|
||||||
{
|
{
|
||||||
if($aClean['ext_hasadmin']=="on")
|
if($aClean['sHasAdmin']=="on")
|
||||||
$oUser->addPriv("admin");
|
$oUser->addPriv("admin");
|
||||||
else
|
else
|
||||||
$oUser->delPriv("admin");
|
$oUser->delPriv("admin");
|
||||||
|
|||||||
Reference in New Issue
Block a user