summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-11 07:55:01 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-11 07:55:01 +0200
commit708dc191227a4b31057ffdabbd521866c532e07f (patch)
tree47039177bcf187d03ea80ffc4b6b1172d37578eb
parent1c415919cb72c218d9491d8cdcf6498142b23f68 (diff)
downloadsemanticscuttle-708dc191227a4b31057ffdabbd521866c532e07f.tar.gz
semanticscuttle-708dc191227a4b31057ffdabbd521866c532e07f.tar.bz2
use correct variable and show error messages
-rw-r--r--www/profile.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/www/profile.php b/www/profile.php
index c2c256c..ccdb7a8 100644
--- a/www/profile.php
+++ b/www/profile.php
@@ -103,7 +103,7 @@ if (POST_SUBMITTED!='' && $currentUser->getId() == $userid) {
}
if (!$error) {
if (!$userservice->updateUser($userid, $detPass, $detName, $detMail, $detPage, $detDesc)) {
- $tplvars['error'] = T_('An error occurred while saving your changes.');
+ $tplVars['error'] = T_('An error occurred while saving your changes.');
} else {
$tplVars['msg'] = T_('Changes saved.');
}
@@ -118,11 +118,11 @@ if (!$userservice->isLoggedOn() || $currentUser->getId() != $userid) {
if (isset($_POST['action']) && $_POST['action'] == 'registerCurrentCert') {
if (!$scert->hasValidCert()) {
- $tplvars['error'] = T_('You do not have a valid SSL client certificate');
+ $tplVars['error'] = T_('You do not have a valid SSL client certificate');
} else if (false !== $scert->getUserIdFromCert()) {
- $tplvars['error'] = T_('This certificate is already registered');
+ $tplVars['error'] = T_('This certificate is already registered');
} else if (false === $scert->registerCurrentCertificate($currentUser->getId())) {
- $tplvars['error'] = T_('Failed to register SSL client certificate.');
+ $tplVars['error'] = T_('Failed to register SSL client certificate.');
} else {
$tplVars['msg'] = T_('SSL client certificate registered.');
}
@@ -131,18 +131,18 @@ if (!$userservice->isLoggedOn() || $currentUser->getId() != $userid) {
) {
$certId = (int)$_POST['certId'];
$cert = $scert->getCert($certId);
+
if ($cert === null) {
- $tplvars['error'] = T_('Certificate not found.');
+ $tplVars['error'] = T_('Certificate not found.');
} else if ($cert->uId != $currentUser->getId()) {
- $tplvars['error'] = T_('The certificate does not belong to you.');
+ $tplVars['error'] = T_('The certificate does not belong to you.');
} else if (false === $scert->delete($certId)) {
- $tplvars['error'] = T_('Failed to delete SSL client certificate.');
+ $tplVars['error'] = T_('Failed to delete SSL client certificate.');
} else {
$tplVars['msg'] = T_('SSL client certificate deleted.');
}
}
-
//Token Init
$_SESSION['token'] = md5(uniqid(rand(), true));
$_SESSION['token_stamp'] = time();