// 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($Language->getText('tracker_artifact','error_no_anonymous'));
+ return false;
} else {
$user_id=100;
if (!$by || !validate_email($by)) {
<?php } else { ?>
<h3><FONT COLOR="RED">
- <?php echo $Language->getText('tracker','please_login',array('<a href="/account/login.php?return_to='.urlencode($REQUEST_URI).'">','</a>')) ?></FONT></h3><br />
+ <?php echo $Language->getText('tracker','please_login',array('<a href="/account/login.php?return_to='.urlencode($REQUEST_URI).'">','</a>')) ?></FONT></h3>
+ <?php if ($ath->allowsAnon()) { ?>
<?php echo $Language->getText('tracker','insert_email') ?>
+ <br />
<p>
<input type="TEXT" name="user_email" SIZE="20" MAXLENGTH="40">
-
+ <?php } ?>
<?php } ?>
<p>
<tr><td colspan="2">
<br />
<?php echo $ah->showDetails(); ?>
+ <?php if ($ath->allowsAnon() || session_loggedin()) { ?>
<input type="hidden" name="func" value="postmod">
<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>">
<strong><?php echo $Language->getText('tracker_detail','add_comment') ?>:</strong>
<?php echo notepad_button('document.forms[1].details') ?><br />
<textarea name="details" ROWS="10" COLS="60" WRAP="SOFT"></textarea>
+ <?php } ?>
</td></tr>
<tr><td colspan="2">
?>
</td></tr>
+ <?php if ($ath->allowsAnon() || session_loggedin()) { ?>
<tr><td colspan="2">
<h3><?php echo $Language->getText('tracker_detail','security_note') ?></h3>
<p>
<input type="submit" name="submit" value="<?php echo $Language->getText('general','submit') ?>">
</form>
</td></tr>
+ <?php } ?>
<?php
$hookParams['artifact_id']=$aid;
$links[] = '/tracker/?func=browse&group_id='.$group_id.'&atid='. $this->getID();
$labels[] = $Language->getText('tracker_artifacttype','csv');
$links[] = '/tracker/?func=downloadcsv&group_id='.$group_id.'&atid='. $this->getID();
- $labels[] = $Language->getText('tracker_artifacttype','submit_new');
- $links[] = '/tracker/?func=add&group_id='.$group_id.'&atid='. $this->getID();
+ if ($this->allowsAnon() || session_loggedin()) {
+ $labels[] = $Language->getText('tracker_artifacttype','submit_new');
+ $links[] = '/tracker/?func=add&group_id='.$group_id.'&atid='. $this->getID();
+ }
if (session_loggedin()) {
$labels[] = $Language->getText('tracker_artifacttype','reporting');
switch ($func) {
case 'add' : {
- include ('add.php');
+ if (!$ath->allowsAnon() && !session_loggedin()) {
+ exit_error('ERROR',$Language->getText('tracker_artifact','error_no_anonymous'));
+ } else {
+ include ('add.php');
+ }
break;
}
case 'postadd' : {
$ah=new ArtifactHtml($ath);
if (!$ah || !is_object($ah)) {
exit_error('ERROR','Artifact Could Not Be Created');
+ } else if (!$ath->allowsAnon() && !session_loggedin()) {
+ exit_error('ERROR',$Language->getText('tracker_artifact','error_no_anonymous'));
} else {
if (empty($user_email)) {
$user_email=false;
exit_error('ERROR','Artifact Could Not Be Created');
} else if ($ah->isError()) {
exit_error('ERROR',$ah->getErrorMessage());
+ } else if (!$ath->allowsAnon() && !session_loggedin()) {
+ exit_error('ERROR',$Language->getText('tracker_artifact','error_no_anonymous'));
} else {
/*