Skip to content

Commit

Permalink
Removed hardcoded references to Ryerson
Browse files Browse the repository at this point in the history
  • Loading branch information
steven1350 committed Oct 16, 2018
1 parent 4528c65 commit f68313d
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 18 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
1. `USER_AGENT` - What other servers will see when connecting to external web services
1. `SITE_TITLE` - Title of the booking system used for mobile interface
1. `SITE_LOGO` - Image for the header in the mobile interface
1. `DEFAULT_TEMPLATE` - Template to be used if user has no roles (and hence, not permitted to use the system)
1. `DEFAULT_POLICY_URL` - Policy url to be used if user has no roles (and hence, not permitted to use the system)
1. `DEBUG_MODE` - Used for troubleshooting (adding the GET request variable `debug` will show debugging information). Recommended to leave set to `FALSE`
1. `SITE_ADMIN` - Contact email
1. `REPLY_EMAIL` - Used as the FROM address when the system sends out emails
1. `CONTACT_EMAIL` - Email to be used on mobile template
1. `CONTACT_PHONE` - Telephone number to be used on mobile template
1. `SITE_ADMIN` - Email contact of site administrator
1. `USE_EXTERNAL_HOURS` - Used to pull building hours from external system. Recommended to be set to `FALSE`
1. `EXTERNAL_HOURS_URL` - URL to use if `USE_EXTERNAL_HOURS` is set the `TRUE`
1. `USE_LIBSTAFF_LIST` - Used to pull in an external list of Library staff. Recommended to be set to `FALSE`
Expand Down
8 changes: 7 additions & 1 deletion application/config/constants.php.sample
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
define('USER_AGENT', 'LibraryBooking/1.0');

define('SITE_TITLE', 'Name goes here');
define('SITE_LOGO', 'https://ryersonperformance.ca/sites/default/files/schoolofperformancebrandmark-centrewhite.png');
define('SITE_LOGO', 'https://domain.com/assets/images/logo.png');

//Defaults if user has no roles
define('DEFAULT_TEMPLATE', 'rula_template');
define('DEFAULT_POLICY_URL' 'https://domain.com/room-booking-policy/');

define('DEBUG_MODE', FALSE);
define('SITE_ADMIN', '[email protected]');
define('REPLY_EMAIL', '[email protected]'); //Used as the "FROM" address when sending emails
define('CONTACT_EMAIL', '[email protected]');
define('CONTACT_PHONE' '416-555-5555');

define('USE_EXTERNAL_HOURS', FALSE);
define('EXTERNAL_HOURS_URL', 'https://domain.com/hours_external.cfm');
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ function moderate(){
$this->email->clear();
$this->email->set_mailtype('html');
$this->email->to($data['booker_matrix'].EMAIL_SUFFIX);
$this->email->from(CONTACT_EMAIL);
$this->email->from(REPLY_EMAIL);
$this->email->subject('Your request has been approved');
$this->email->message($email_content);
$this->email->send();
Expand Down Expand Up @@ -1106,7 +1106,7 @@ function moderate(){
$this->email->clear();
$this->email->set_mailtype('html');
$this->email->to($data['booker_matrix'].EMAIL_SUFFIX);
$this->email->from(CONTACT_EMAIL);
$this->email->from(REPLY_EMAIL);
$this->email->subject('Your request has been denied');
$this->email->message($email_content);
$this->email->send();
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/booking.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ function submit(){
$this->email->clear();
$this->email->set_mailtype('html');
$this->email->to($this->session->userdata('username').EMAIL_SUFFIX);
$this->email->from(CONTACT_EMAIL);
$this->email->from(REPLY_EMAIL);
$this->email->subject('Your request is awaiting moderation');
$this->email->message($email_content);
$this->email->send();
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ function login_user(){
//Does the user have any roles in the system? No roles = no access
if(count($roles) === 0){
$this->log_model->log_event('login', $this->session->userdata('username'), "Login Denied", null, implode(',', $cas_roles));
$this->template->load('rula_template', 'denied');
$this->template->load(DEFAULT_TEMPLATE, 'denied');
$this->session->sess_destroy();

}
else if($this->user_model->is_banned($user_data->userlogin)){
$this->template->load('rula_template', 'banned');
$this->template->load($this->role_model->get_theme(), 'banned');
$this->session->sess_destroy();
}
//Successful login
Expand Down Expand Up @@ -195,7 +195,7 @@ function logout(){
$this->session->sess_destroy();

$this->load->library('cas');
$this->cas->logout('http://library.ryerson.ca');
$this->cas->logout(base_url());

$this->template->load('rula_template', 'booking/book_room_form');

Expand Down
2 changes: 1 addition & 1 deletion application/controllers/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function submit(){
$this->email->clear();
$this->email->set_mailtype('html');
$this->email->to($this->session->userdata('username').EMAIL_SUFFIX);
$this->email->from(CONTACT_EMAIL);
$this->email->from(REPLY_EMAIL);
$this->email->subject('Your request is awaiting moderation');
$this->email->message($email_content);
$this->email->send();
Expand Down
2 changes: 1 addition & 1 deletion application/views/banned.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<?php ob_start();?>

<h3 style="text-align: center; font-weight: bold; margin-bottom: 1em;">Ryerson University Library Room Booking</h3>
<h3 style="text-align: center; font-weight: bold; margin-bottom: 1em;"><?php echo SITE_TITLE; ?></h3>
<span style="text-align: center">
<p>Your access to the room booking system has been suspended</p>

Expand Down
2 changes: 1 addition & 1 deletion application/views/booking/edit_book_room_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
for each role. This only appears when not editing/creating new roles
--->

<h3 style="text-align: center; font-weight: bold">Ryerson University Library Room Booking</h3>
<h3 style="text-align: center; font-weight: bold"><?php echo SITE_TITLE; ?></h3>

<?php
//Verify the required fields are present (and the time is a half hour increment (don't let people mess with the URL)
Expand Down
6 changes: 3 additions & 3 deletions application/views/denied.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

<?php ob_start();?>

<h3 style="text-align: center; font-weight: bold; margin-bottom: 1em;">Ryerson University Library Room Booking</h3>
<h3 style="text-align: center; font-weight: bold; margin-bottom: 1em;"><?php echo SITE_TITLE; ?></h3>
<span style="text-align: center">
<p>You do not have access to the Library Room Booking System</p>
<p>You do not have access to the Room Booking System</p>

<p>Please read the <a href="http://library.ryerson.ca/info/policies/study-room-booking-policy/">policy</a> to see if you should have access</p>
<p>Please read the <a href="<?php echo DEFAULT_POLICY_URL; ?>">policy</a> to see if you should have access</p>

<p>If you believe you have reached this page in error, please contact <a href="mailto:<?php echo SITE_ADMIN; ?>"><?php echo SITE_ADMIN; ?></a></p>

Expand Down
2 changes: 1 addition & 1 deletion application/views/email/booking_ics.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Ryerson University Library//NONSGML v1.0//EN
PRODID:-//<?php echo SITE_TITLE; ?>//NONSGML v1.0//EN
BEGIN:VEVENT
UID:<?php echo $this->session->userdata('username').EMAIL_SUFFIX. ":". $booking_id. "\n"; ?>
DTSTAMP:<?php echo date('Ymd\THis\ZO', $start). "\n"; ?>
Expand Down
6 changes: 3 additions & 3 deletions application/views/mobile_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<html lang="en-US">
<!--<![endif]-->
<head>
<title>Room Booking - Ryerson University Library and Archives</title>
<title><?php echo SITE_TITLE; ?></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Expand Down Expand Up @@ -45,8 +45,8 @@

<div class="footer">
<a rel="external" href="<?php echo base_url(); ?>booking">Full Site</a> |
<a href="mailto:[email protected]">[email protected]</a> |
<a href="tel:416-979-5055">416-979-5055</a>
<a href="mailto:<?php echo CONTACT_EMAIL; ?>"><?php echo CONTACT_EMAIL; ?></a> |
<a href="tel:<?php echo CONTACT_PHONE; ?>"><?php echo CONTACT_PHONE; ?></a>
</div>

<script>
Expand Down

0 comments on commit f68313d

Please sign in to comment.