From 22b3e49d9266624b3bdbb9c3e9812bb281b8cc37 Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Tue, 9 Jun 2009 16:09:00 +0000
Subject: [PATCH] Modify the code to check that a request type is valid to pull
 the list of types from the database.

---
 application/modules/requests/models/RequestModel.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/modules/requests/models/RequestModel.php b/application/modules/requests/models/RequestModel.php
index 16390e2e..05a81ae6 100644
--- a/application/modules/requests/models/RequestModel.php
+++ b/application/modules/requests/models/RequestModel.php
@@ -719,10 +719,10 @@ class Requests_RequestModel extends Unl_Model
     {
         return $this->_data['typeDescription'];
     }
-
+    
 	public function setType($type)
 	{
-        if (!in_array($type, array('NewCourse', 'ChangeCourse', 'RemoveCourse', 'AddISToCourse', 'NewCourseWithIS', 'NewCourseWithACE', 'AddACEToCourse', 'AddACEAndChangeCourse', 'RemoveACEFromCourse', 'RemoveACEAndChangeCourse'))) {
+        if (!in_array($type, $this->getTypes())) {
             throw new Exception('Unknown request type!');
         }
 
-- 
GitLab