Ejemplo n.º 1
0
 /////////////////////////////////////////////////////////////
 // STEP 2 - change control
 if ($ok) {
     //we really need this not be interupted
     ignore_user_abort(TRUE);
     set_time_limit(3600);
     //create new change control object
     $ticket = new GridImageTroubleTicket();
     $ticket->setSuggester($USER->user_id, $USER->realname);
     if ($isadmin && !empty($_REQUEST['mod'])) {
         $ticket->setModerator($USER->user_id);
     }
     if (!empty($_REQUEST['type'])) {
         $ticket->setType($_REQUEST['type']);
     }
     $ticket->setPublic(isset($_REQUEST['public']) ? $_REQUEST['public'] : 'everyone');
     $ticket->setImage($_REQUEST['id']);
     $ticket->setNotes($updatenote);
     if (strlen($imageclassother)) {
         $imageclass = $imageclassother;
     }
     //attach the various field changes
     $ticket->updateField("title1", $image->title1, $title, $moderated["title"]);
     $ticket->updateField("comment1", $image->comment1, $comment, $moderated["comment"]);
     $ticket->updateField("title2", $image->title2, $title2, $moderated["title2"]);
     $ticket->updateField("comment2", $image->comment2, $comment2, $moderated["comment2"]);
     $ticket->updateField("imageclass", $image->imageclass, $imageclass, $moderated["imageclass"]);
     $ticket->updateField("imagetaken", $image->imagetaken, $imagetaken, $moderated["imagetaken"]);
     $ticket->updateField("grid_reference", $image->subject_gridref, $grid_reference, $moderated["grid_reference"]);
     $ticket->updateField("photographer_gridref", $image->photographer_gridref, $photographer_gridref, $moderated["photographer_gridref"]);
     $ticket->updateField("view_direction", $image->view_direction, $view_direction, $moderated["view_direction"]);
Ejemplo n.º 2
0
     } else {
         echo "NOT LOGGED IN";
     }
 } else {
     //we really need this not be interupted
     ignore_user_abort(TRUE);
     set_time_limit(3600);
     $status2 = $db->Quote($status);
     $db->Execute("INSERT INTO moderation_log SET user_id = {$USER->user_id}, gridimage_id = {$gridimage_id}, new_status={$status2}, old_status='{$image->moderation_status}',created=now(),type = 'real'");
     $info = $image->setModerationStatus($status, $USER->user_id);
     echo $info;
     if ($status == 'rejected') {
         $ticket = new GridImageTroubleTicket();
         $ticket->setSuggester($USER->user_id);
         $ticket->setModerator($USER->user_id);
         $ticket->setPublic('everyone');
         $ticket->setImage($gridimage_id);
         if (!empty($_GET['comment'])) {
             $ticket->setNotes("Auto-generated ticket, as a result of Moderation. Rejecting this image because: " . stripslashes($_GET['comment']));
         } else {
             $ticket->setNotes("Auto-generated ticket, as a result of Moderation. Please leave a comment to explain the reason for rejecting this image.");
         }
         $status = $ticket->commit('open');
         echo " <a href=\"/editimage.php?id={$gridimage_id}\"><B>View Ticket</b></a>";
     }
     //clear caches involving the image
     $smarty->clear_cache('view.tpl', "{$gridimage_id}_0_0");
     $smarty->clear_cache('view.tpl', "{$gridimage_id}_0_1");
     $smarty->clear_cache('view.tpl', "{$gridimage_id}_1_0");
     $smarty->clear_cache('view.tpl', "{$gridimage_id}_1_1");
     //clear the users profile cache
Ejemplo n.º 3
0
 function setCredit($realname)
 {
     global $USER;
     if (!$this->isValid()) {
         return "Invalid image";
     }
     $db = $this->_getDB();
     $db->Execute(sprintf("update gridimage set realname = %s where gridimage_id=%d", $db->Quote($realname), $this->gridimage_id));
     $ticket = new GridImageTroubleTicket();
     $ticket->setSuggester($USER->user_id);
     $ticket->setPublic('everyone');
     ## dont thing any case for this to be anon, its either a mod or the owner
     $ticket->setImage($this->gridimage_id);
     #$ticket->setNotes("Credit changed to '$realname'");
     $ticket->updateField("realname", $this->realname, $realname, false);
     $status = $ticket->commit('closed');
     $this->realname = $realname;
     $this->updateCachedTables();
 }