Skip to content

Commit

Permalink
Merge branch 'release/3.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
aarpon committed Dec 13, 2019
2 parents 0891e1e + 320a791 commit 612b8d1
Show file tree
Hide file tree
Showing 85 changed files with 3,965 additions and 2,578 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ css/custom.css

# macOS finder files
*.DS_Store
*.phpunit.result.cache
2 changes: 1 addition & 1 deletion aberration_correction.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/* In this page, all parameters are required! */
$parameterNames = $_SESSION['setting']->correctionParameterNames();
$db = new DatabaseConnection();
$db = DatabaseConnection::get();
foreach ($parameterNames as $name) {
/** @var Parameter $parameter */
$parameter = $_SESSION['setting']->parameter($name);
Expand Down
55 changes: 16 additions & 39 deletions account.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,11 @@
exit();
}

if (isset($_SERVER['HTTP_REFERER']) &&
!strstr($_SERVER['HTTP_REFERER'], 'account')
) {
if (isset($_SERVER['HTTP_REFERER']) && !strstr($_SERVER['HTTP_REFERER'], 'account')) {
$_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
}

if (isset($_SESSION['account_user'])) {

// Make sure the User is properly loaded
$edit_user = $_SESSION['account_user'];

Expand All @@ -100,62 +97,47 @@
*
**************************************************************************** */

// If updating some other User setting, remove the loaded
// User from the session and return to the referer page.
if ((isset($_POST['cancel']))) {
unset($_SESSION['account_user']);
header("Location: " . $_SESSION['referer']);
exit();
}

if (isset($_POST['modify'])) {

// Initialize the result to True
$result = True;
$result = true;

// E-mail address
if (UserManager::canModifyEmailAddress($edit_user)) {

// Check that a valid e-mail address was provided
if ($clean['email'] == "") {
$result = False;
$result = false;
$message = "Please fill in the email field with a valid address";
} else {
$emailToUse = $clean['email'];
}

} else {

// Use current e-mail address
$emailToUse = $edit_user->emailAddress();

}

// User group
if (UserManager::canModifyGroup($edit_user)) {

// Check that a valid group was provided
if ($clean['group'] == "") {
$result = False;
$result = false;
$message = "Please fill in the group field";
} else {
$groupToUse = $clean['group'];
}

} else {

// Use current group
$groupToUse = $edit_user->userGroup();

}

// Passwords
if ($clean['pass1'] == "" || $clean['pass2'] == "") {
$result = False;
$result = false;
$message = "Please fill in both password fields";
} else {
if ($clean['pass1'] != $clean['pass2']) {
$result = False;
$result = false;
$message = "Passwords do not match";
} else {
$passToUse = $clean['pass1'];
Expand All @@ -164,32 +146,29 @@

// Update the information in the database
if ($result == true) {

// Update the User information
if (UserManager::canModifyEmailAddress($edit_user)) {
$edit_user->SetEmailAddress($emailToUse);
}
if (UserManager::canModifyGroup($edit_user)) {
$edit_user->SetGroup($groupToUse);
}
$success = UserManager::storeUser($edit_user, true);
try {
$success = UserManager::storeUser($edit_user, true);
} catch (Exception $e) {
$success = false;
}

if ($success == true) {

// Now we need to update the password (and update the success
// status).
$success &= UserManager::changeUserPassword($edit_user->name(),
$passToUse);

$success &= UserManager::changeUserPassword($edit_user->name(), $passToUse);
}

if (!$success) {

$message = "Sorry, an error occurred and the user data could " .
"not be updated!";
$message = "Sorry, an error occurred and the user data could not be updated!";

} else {

// If updating some other User setting, remove the modified
// User from the session and return to the user management page.
if (isset($_SESSION['account_user'])) {
Expand Down Expand Up @@ -255,7 +234,6 @@
$somethingToChange = false;

if (UserManager::canModifyEmailAddress($edit_user)) {

$emailForForm = "";
if ($clean['email'] != "") {
$emailForForm = $clean['email'];
Expand All @@ -279,7 +257,6 @@
<?php

if (UserManager::canModifyGroup($edit_user)) {

$emailForForm = "";
if ($clean['group'] != "") {
$groupForForm = $clean['group'];
Expand Down Expand Up @@ -318,7 +295,7 @@
$somethingToChange = true;
}
?>
<p/>
<p>&nbsp;</p>

<?php
$referer = $_SESSION['referer'];
Expand All @@ -329,7 +306,7 @@
if ($somethingToChange == true) {
?>
<div id="controls">
<input type="submit" name="cancel" value=""
<input type="button" name="cancel" value=""
class="icon cancel"
onmouseover="TagToTip('ttSpanCancel' )"
onmouseout="UnTip()"
Expand All @@ -352,7 +329,7 @@ class="icon cancel"
onclick="document.location.href='<?php echo $referer ?>'"/>
</div>

<?php
<?php
}
?>
</form>
Expand Down
6 changes: 6 additions & 0 deletions add_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
* END OF SANITIZE INPUT
*
*/

if (isset($_GET['home'])) {
header("Location: " . "home.php");
exit();
}

// Add the user
if (isset($_POST['add'])) {

Expand Down
4 changes: 2 additions & 2 deletions ajax/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function getJobQueueTable()
foreach ($rows as $row) {
if ($row['status'] == "started") {
$color = '#99ffcc';
} else if ($row['status'] == "broken" || $row['status'] == "kill") {
} else if ($row['status'] == "delete" || $row['status'] == "kill") {
$color = '#ff9999';
} else if ($index % 2 == 0) {
$color = '#ffccff';
Expand All @@ -159,7 +159,7 @@ function getJobQueueTable()
$_SESSION['user']->isAdmin()
) {

if ($row['status'] != "broken") {
if ($row['status'] != "delete" && $row['status'] != "kill") {

$data .= '
<td>
Expand Down
Loading

0 comments on commit 612b8d1

Please sign in to comment.