Skip to content
Snippets Groups Projects
Commit 50fedbb7 authored by Tim Steiner's avatar Tim Steiner
Browse files

Allow administrators to do an "administrative edit" request.

parent 4ee855f8
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,16 @@ class Courses_NewController extends App_Controller_Action
$render = 'create';
}
$user = Auth_UserModel::findCurrentUser();
$groups = Auth_GroupModel::findByUser($user);
$this->view->isAdmin = false;
foreach ($groups as $group) {
if ($group->getName() != 'root') {
continue;
}
$this->view->isAdmin = true;
}
$this->view->subject = $in->subject;
$this->view->courseLetter = $in->courseLetter;
$this->view->courseNumber = $in->courseNumber;
......
......@@ -87,6 +87,17 @@
That this course be <b>removed</b>
</a>
</li>
<?php if ($this->isAdmin) { ?>
<li>
<a href="<?php echo $this->url(array('action' => 'create',
'type' => 'AdminEdit',
'subject' => $this->subject,
'courseNumber' => $this->courseNumber,
'courseLetter' => $this->courseLetter)); ?>">
To make an <b>administrative edit</b>
</a>
</li>
<?php } ?>
<li>
<a href="<?php echo $this->baseUrl(); ?>/courses/new/search">
Return to Search
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment