2006-06-16 23:53:56 +00:00
|
|
|
<?php
|
2007-11-12 20:57:15 +00:00
|
|
|
// Change the status of a thread.
|
|
|
|
// A thread can be either unsolved or solved (used in the Q&A part)
|
2006-06-16 23:53:56 +00:00
|
|
|
|
|
|
|
require_once('../inc/forum.inc');
|
|
|
|
|
|
|
|
$threadid = get_int('id');
|
2007-11-12 20:57:15 +00:00
|
|
|
$thread = BoincThread::lookup_id($threadid);
|
|
|
|
$logged_in_user = get_logged_in_user();
|
2006-06-16 23:53:56 +00:00
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
$owner = BoincUser::lookup_id($thread->owner);
|
|
|
|
if ($logged_in_user->id == $owner->id){
|
|
|
|
$ret = $thread->update("status=".THREAD_SOLVED);
|
|
|
|
if (!$ret){
|
|
|
|
error_page("Could not update the status of the thread: ".$thread->id);
|
2006-06-16 23:53:56 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
error_page("You must be the owner of the thread to do this");
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------
|
|
|
|
|
|
|
|
page_head("Status of the thread");
|
|
|
|
echo "<p>The status has been updated. Thank you!</p>";
|
2007-11-12 20:57:15 +00:00
|
|
|
echo "<p><a href=\"forum_thread.php?nowrap=true&id=".$thread->id."\">Return to the thread</a></p>";
|
2006-06-16 23:53:56 +00:00
|
|
|
page_tail();
|
|
|
|
?>
|