Changeset 1336
- Timestamp:
- 03/15/08 19:15:30 (5 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 3 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/classes/Content.php (modified) (4 diffs)
-
wifidog/classes/User.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1334 r1336 1 1 # $Id$ 2 2008-03-15 Benoit Grégoire <bock@step.polymtl.ca> 3 * Content.php: Eliminate the generation of a large number of useless SQL queries when getting Content metadata. 4 * User.php: Do the same thing for getCurrentUser() 5 2 6 2008-03-12 Benoit Grégoire <bock@step.polymtl.ca> 3 7 * Major performance improvement in content manager for content groups picking items with limits on how many times they can be displayed. -
trunk/wifidog-auth/wifidog/classes/Content.php
r1334 r1336 1070 1070 */ 1071 1071 public function getTitle() { 1072 try {1073 return self :: getObject($this->content_row['title']);1074 } catch (Exception $e) {1075 return null;1076 }1072 $retval = null; 1073 if(!empty($this->content_row['title'])){ 1074 $retval = self :: getObject($this->content_row['title']); 1075 } 1076 return $retval; 1077 1077 } 1078 1078 … … 1082 1082 */ 1083 1083 public function getDescription() { 1084 try {1085 return self :: getObject($this->content_row['description']);1086 } catch (Exception $e) {1087 return null;1088 }1084 $retval = null; 1085 if(!empty($this->content_row['description'])){ 1086 $retval = self :: getObject($this->content_row['description']); 1087 } 1088 return $retval; 1089 1089 } 1090 1090 … … 1094 1094 */ 1095 1095 public function getLongDescription() { 1096 try {1097 return self :: getObject($this->content_row['long_description']);1098 } catch (Exception $e) {1099 return null;1100 }1096 $retval = null; 1097 if(!empty($this->content_row['long_description'])){ 1098 $retval = self :: getObject($this->content_row['long_description']); 1099 } 1100 return $retval; 1101 1101 } 1102 1102 … … 1106 1106 */ 1107 1107 public function getProjectInfo() { 1108 try {1109 return self :: getObject($this->content_row['project_info']);1110 } catch (Exception $e) {1111 return null;1112 }1108 $retval = null; 1109 if(!empty($this->content_row['project_info'])){ 1110 $retval = self :: getObject($this->content_row['project_info']); 1111 } 1112 return $retval; 1113 1113 } 1114 1114 -
trunk/wifidog-auth/wifidog/classes/User.php
r1321 r1336 104 104 require_once ('classes/Session.php'); 105 105 $session = Session::getObject(); 106 $sessCurrentUserId = $session->get(SESS_USER_ID_VAR); 106 107 $user = null; 107 try { 108 $user = self :: getObject($session->get(SESS_USER_ID_VAR)); 109 //$user = new User($session->get(SESS_USER_ID_VAR)); 110 } catch (Exception $e) { 111 /**If any problem occurs, the user should be considered logged out*/ 112 $session->set(SESS_USER_ID_VAR, null); 108 if(!empty($sessCurrentUserId)){ 109 try { 110 $user = self :: getObject($sessCurrentUserId); 111 //$user = new User($session->get(SESS_USER_ID_VAR)); 112 } catch (Exception $e) { 113 /**If any problem occurs, the user should be considered logged out*/ 114 $session->set(SESS_USER_ID_VAR, null); 115 } 113 116 } 114 117 return $user;
