|
From: <al...@us...> - 2008-07-08 03:37:07
|
Revision: 604
http://sciret.svn.sourceforge.net/sciret/?rev=604&view=rev
Author: alpeb
Date: 2008-07-07 20:37:05 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
use class constants instead of global constants
Modified Paths:
--------------
branches/release-candidates/sciret-1.2/actions/DeleteArticle.php
branches/release-candidates/sciret-1.2/actions/SaveArticle.php
branches/release-candidates/sciret-1.2/actions/SavePreferences.php
Modified: branches/release-candidates/sciret-1.2/actions/DeleteArticle.php
===================================================================
--- branches/release-candidates/sciret-1.2/actions/DeleteArticle.php 2008-07-08 03:36:20 UTC (rev 603)
+++ branches/release-candidates/sciret-1.2/actions/DeleteArticle.php 2008-07-08 03:37:05 UTC (rev 604)
@@ -20,7 +20,7 @@
if ($this->configuration->getConfigValue('restrictEditDelete')) {
$article = new Article($artId);
- if ($article->getUserId() != $this->user->getId() && ($this->user->getRole() & ROLE_ADMIN) != ROLE_ADMIN) {
+ if ($article->getUserId() != $this->user->getId() && ($this->user->getRole() & User::ROLE_ADMIN) != User::ROLE_ADMIN) {
$_SESSION['message'] = $this->user->lang('Sorry, only the author or an admin can delete this article.');
Library::redirect(Library::getLink(array('view' => 'ViewArticle', 'id' => $artId)));
}
Modified: branches/release-candidates/sciret-1.2/actions/SaveArticle.php
===================================================================
--- branches/release-candidates/sciret-1.2/actions/SaveArticle.php 2008-07-08 03:36:20 UTC (rev 603)
+++ branches/release-candidates/sciret-1.2/actions/SaveArticle.php 2008-07-08 03:37:05 UTC (rev 604)
@@ -20,7 +20,7 @@
if ($articleId > 0 && $this->configuration->getConfigValue('restrictEditDelete')) {
$article = new Article($articleId);
- if ($article->getUserId() != $this->user->getId() && ($this->user->getRole() & ROLE_ADMIN) != ROLE_ADMIN) {
+ if ($article->getUserId() != $this->user->getId() && ($this->user->getRole() & User::ROLE_ADMIN) != User::ROLE_ADMIN) {
$_SESSION['message'] = $this->user->lang('Sorry, only the author or an admin can modify this article.');
Library::redirect(Library::getLink(array('view' => 'ViewArticle', 'id' => $articleId)));
}
Modified: branches/release-candidates/sciret-1.2/actions/SavePreferences.php
===================================================================
--- branches/release-candidates/sciret-1.2/actions/SavePreferences.php 2008-07-08 03:36:20 UTC (rev 603)
+++ branches/release-candidates/sciret-1.2/actions/SavePreferences.php 2008-07-08 03:37:05 UTC (rev 604)
@@ -32,7 +32,7 @@
$this->user->setPreference('navigationType', $_POST['navigationType']);
}
- if (($this->user->getRole() & ROLE_ADMIN) == ROLE_ADMIN) {
+ if (($this->user->getRole() & User::ROLE_ADMIN) == User::ROLE_ADMIN) {
$this->configuration->setConfigValue('publishKB', $_POST['publishKB'] == '1'? '1' : '0');
$this->configuration->setConfigValue('publishArticlesAuto', $_POST['publishArticlesAuto'] == '1'? '1' : '0');
$this->configuration->setConfigValue('publishBookmarksAuto', $_POST['publishBookmarksAuto'] == '1'? '1' : '0');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|