// make sure this person has permission to add artifacts
//
- if (!$this->ArtifactType->isPublic()) {
- //
- // Only admins can post/modify private artifacts
- //
-
-//
-// ape: Disabled, private means only restricted to members. So, no special rules #2503.
-// if (!forge_check_perm ('tracker_admin', $this->ArtifactType->Group->getID()) {
-// $this->setError(_('Only Artifact Admins Can Modify Private Artifact Types'));
-// return false;
-// }
- }
-
//
// get the user_id
//
if(array_key_exists('user', $importData)){
$user = $importData['user'];
} else {
+ if (!forge_check_perm ('tracker',$this->ArtifactType->getID(),'submit')) {
+ $this->setError(_('You are not currently allowed to submit items to this tracker.'));
+ return false;
+ }
+
if (session_loggedin()) {
$user=user_getid();
} else {
- if ($this->ArtifactType->allowsAnon()) {
- $user=100;
- } else {
- $this->setError(_('This Artifact Type Does Not Allow Anonymous Submissions. Please Login.'));
- return false;
- }
+ $user=100;
}
}
$this->setMissingParamsError();
return false;
}
+ if (!forge_check_perm ('tracker',$this->ArtifactType->getID(),'submit')) {
+ $this->setError(_('You are not currently allowed to submit items to this tracker.'));
+ return false;
+ }
if (session_loggedin()) {
$user_id=user_getid();
$user =& user_get_object($user_id);
// we'll store this email even though it will likely never be used -
// since we have their correct user_id, we can join the USERS table to get email
$by=$user->getEmail();
- } elseif (!$this->ArtifactType->allowsAnon()) {
- $this->setError(_('This Artifact Type Does Not Allow Anonymous Submissions. Please Login.'));
- return false;
} else {
$user_id=100;
if (!$by || !validate_email($by)) {
default:
$aa=$a->getExtraFieldDataText();
$ba=$b->getExtraFieldDataText();
- $af=$aa[$this->criterion]['value'];
- $bf=$ba[$this->criterion]['value'];
+ if(!isset($this->criterion) || empty($this->criterion)) {
+ $criterion = 1;
+ }
+ else {
+ $criterion = $this->criterion;
+ }
+ $af=$aa[$criterion]['value'];
+ $bf=$ba[$criterion]['value'];
$namecmp = strcoll ($af,$bf) ;
if ($namecmp != 0) {
return $namecmp ;