Exemple #1
0
 public function approveAnnouncement($AnnouncementID)
 {
     if ($this->isApprover(IWU_Auth::getUser())) {
         return parent::updateRow('Announcements', array('AnnouncementID' => $AnnouncementID), array('ApprovedBy' => IWU_Auth::getUser(), 'ApprovedDate' => date('Y-m-d H:i:s')));
     }
 }
Exemple #2
0
<?php

$DEV = strpos($_SERVER['REQUEST_URI'], '~') != 0;
set_include_path(get_include_path() . PATH_SEPARATOR . ($DEV ? '/home/mgorman/public_html/_resources/php' : '/var/www/php.iwu.edu/htdocs/_resources/php'));
require_once '_class.IWU_DB.php';
require_once '_class.IWU_DataRow.php';
require_once '_class.IWU_Auth.php';
require_once '_class.IWU_Template.php';
require_once '_class.IWU_Paginate.php';
require_once '_db.php';
IWU_Auth::forceAuthentication();
if (userHasRole(IWU_Auth::getUser(), 'admin') && isset($_GET['impersonate'])) {
    $user = $_GET['impersonate'];
} else {
    $user = IWU_Auth::getUser();
}
$roles = getRoles($user);
class Channel
{
    protected $slug = '';
    protected $heading = '';
    protected $styles = array();
    protected $classes = array('highlight');
    protected $context = '';
    protected $contexts = array();
    protected $contentHTML = '';
    public function __construct($slug, $heading, $content = '', $max_height = NULL)
    {
        $this->slug = $slug;
        $this->heading = $heading;
        $this->contentHTML = $content;
Exemple #3
0
$channels['jobs']->addClass('blocks');
//$channels['weekly'] = new Channel('weekly', 'Campus Weekly');
//$channels['weekly']->addContext('default', '_channel.weekly.php');
$channels['athletics'] = new Channel('athletics', 'Titan Athletics');
$channels['athletics']->addContext('default', '_channel.athletics.php');
$channels['dosa_forms'] = new Channel('dosa_forms', 'Online Forms');
$channels['dosa_forms']->addContext('default', '_channel.dosa_forms.php');
$channels['service_requests'] = new Channel('service_requests', 'Service Requests');
$channels['service_requests']->addContext('default', '_channel.service_requests.php');
$channels['physical_plant'] = new Channel('physical_plant', 'Physical Plant');
$channels['physical_plant']->addContext('default', '_channel.physical_plant.php');
$channels['helpdesk'] = new Channel('helpdesk', 'ITS Helpdesk');
$channels['helpdesk']->addContext('default', '_channel.helpdesk.php');
$channels['media'] = new Channel('media', 'Media & Publications');
$channels['media']->addContext('default', '_channel.media.php');
$channels['student_life'] = new Channel('student_life', 'Student Life');
$channels['student_life']->addContext('default', '_channel.student_life.php');
$channels['departments'] = new Channel('departments', 'Departments & Offices');
$channels['departments']->addContext('default', '_channel.departments.php');
foreach ($channels as $name => $channel) {
    if ($db->getChannelStatus($name, IWU_Auth::getUser()) === 'hidden') {
        $channel->addClass('hiddenChannel');
    }
    echo $channel;
}
?>
</div>
<div class="clearfix" style="clear: both;"></div>
<?php 
$page->contentPrimary = ob_get_clean();
echo $page;
        $start_time = date('Ymd\\THis\\Z', strtotime('2016-12-31 00:00:00'));
        $end_time = date('Ymd\\THis\\Z', strtotime('2016-12-31 23:59:59'));
        $now = date('Ymd\\THis\\Z');
        $UID = "announcement-{$AnnouncementID}@php.iwu.edu";
        $email_message = <<<EOT
BEGIN:VCALENDAR
VERSION:2.0
PRODID:PHP
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:{$start_time}
DTEND:{$end_time}
DESCRIPTION:{$announcement_data['Body']}
SUMMARY:{$announcement_data['Headline']}
ORGANIZER;CN=Tommy Titan:MAILTO:ttitan@iwu.edu
LOCATION:{$announcement_data['Where']}
UID:{$UID}
SEQUENCE:0
DTSTAMP:{$now}
END:VEVENT
END:VCALENDAR
EOT;
        mail($DEV ? '*****@*****.**' : '*****@*****.**', 'New Announcement for Calendar', $email_message, $email_headers);
    }
}
if (isset($_POST['Action']) && $_POST['Action'] === 'Approve' && $announcements_db->isApprover(IWU_Auth::getUser())) {
    $announcements_db->approveAnnouncement($_POST['AnnouncementID']);
    header('Location: _channel.announcements.approve.php');
    die;
}
header('Location: _channel.announcements.php');
}
</style>
<form onsubmit="submitForm($(this), 'post'); return false;">
<div class="post <?php 
echo $lost_type;
?>
">
	<h1 class="ItemName">Short Description</h1>
	<h2><?php 
echo IWU_Auth::getAttribute('displayName');
?>
<br /><a href="mailto:<?php 
echo IWU_Auth::getUser();
?>
@iwu.edu"><?php 
echo IWU_Auth::getUser();
?>
@iwu.edu</a></h2>
	<h3><span class="type"><?php 
echo $lost_type;
?>
</span> <span class="Date_Month"><?php 
echo date('F');
?>
</span> <span class="Date_Day"><?php 
echo date('j');
?>
</span></h3>
	<p class="description"><em>Description:</em> <span class="Description"></span></p>
	<p class="location"><em>Where was it?</em> <span class="Location"></span></p>
	<div>
    ?>
'}); return false;" href="">
			<h3><?php 
    echo $announcement['Headline'];
    ?>
</h3>
		</a>
	</article>
<?php 
}
if ($announcements_pagination->pageCount() > 1) {
    ?>
<div class="pagination">
<?php 
    echo $announcements_pagination->getLinks();
    ?>
</div>
<?php 
}
?>
<div class="bottom">
	<a onclick="changeChannel($(this).closest('section'), 'create'); return false;" href="">Submit an Announcement</a>
	<?php 
if ($announcements_db->isApprover(IWU_Auth::getUser())) {
    ?>
		<br /><a onclick="changeChannel($(this).closest('section'), 'approve'); return false;" href="">Approve Announcements</a>
	<?php 
}
?>
</div>
<?php

require_once '_db.php';
require_once '_db.classified.php';
require_once '_functions.php';
$classified_db = new ClassifiedDB();
$Headline = $_POST['Headline'];
$Description = $_POST['Description'];
$Email = IWU_Auth::getUser() . '@iwu.edu';
$Name = IWU_Auth::getAttribute('displayName');
$classified_db->addAd(array('Headline' => $Headline, 'Description' => $Description, 'Email' => $Email, 'Name' => $Name));
header('Location: _channel.classified.php');