@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - public static function getOpenIdUserFromJWT($jwt) { |
|
| 192 | + public static function getOpenIdUserFromJWT($jwt) { |
|
| 193 | 193 | if (self::validateJWT($jwt, null)) { |
| 194 | 194 | $openId = self::getPayloadFromToken($jwt); |
| 195 | 195 | if ($openId['sub']) { |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | return null; |
| 202 | - } |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | 204 | public static function isExpired($exp){ |
| 205 | 205 | return false; |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @param ApplicationMicroReference[] $references |
| 33 | 33 | */ |
| 34 | 34 | public static function getApplicationMicroReferencesForJobApplication($jobPosterApplicationId, $locale) { |
| 35 | - $link = BaseDAO::getConnection(); |
|
| 35 | + $link = BaseDAO::getConnection(); |
|
| 36 | 36 | |
| 37 | 37 | $sqlStr = " |
| 38 | 38 | SELECT |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | try {
|
| 100 | 100 | $sql->execute() or die("ERROR: " . implode(":", $conn->errorInfo()));
|
| 101 | 101 | $sql->setFetchMode( PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'JobPoster',array( |
| 102 | - 'id', 'locale_id', 'manager_user_id', 'title', 'description', 'applicants_to_date', 'term_qty', 'term_units', 'job_min_level', |
|
| 102 | + 'id', 'locale_id', 'manager_user_id', 'title', 'description', 'applicants_to_date', 'term_qty', 'term_units', 'job_min_level', |
|
| 103 | 103 | 'job_max_level', 'start_date','open_date', 'close_date', 'department', 'branch', 'division', 'location_province', 'location_city', |
| 104 | 104 | 'remuneration_range_low','remuneration_range_high','impact','key_tasks','core_competencies','dev_competencies', |
| 105 | 105 | 'classification', 'security_clearance', 'language_requirement' |
| 106 | - )); |
|
| 106 | + )); |
|
| 107 | 107 | $jobPosters = $sql->fetchAll(); |
| 108 | 108 | //var_dump($rows); |
| 109 | 109 | } catch (PDOException $e) {
|
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | 'id', 'locale_id', 'manager_user_id', 'title', 'description', 'applicants_to_date', 'term_qty', 'term_units', 'job_min_level', |
| 202 | 202 | 'job_max_level', 'start_date', 'open_date', 'close_date', 'department', 'branch', 'division', 'location_province', 'location_city', |
| 203 | 203 | 'remuneration_range_low','remuneration_range_high','impact','classification','security_clearance', 'language_requirement', |
| 204 | - )); |
|
| 204 | + )); |
|
| 205 | 205 | $jobPoster = $sql->fetch(); |
| 206 | 206 | } catch (PDOException $e) {
|
| 207 | 207 | BaseDAO::closeConnection($link); |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | $sqlAssetType->execute() or die("ERROR: " . implode(":", $link->errorInfo()));
|
| 501 | 501 | |
| 502 | 502 | if (sizeof($key_task_data) > 0) |
| 503 | - $sql4->execute($key_task_data) or die("ERROR: " . implode(":", $link->errorInfo()));
|
|
| 503 | + $sql4->execute($key_task_data) or die("ERROR: " . implode(":", $link->errorInfo()));
|
|
| 504 | 504 | if (sizeof($core_competency_data) > 0) |
| 505 | 505 | $sql5->execute($core_competency_data) or die("ERROR: " . implode(":", $link->errorInfo()));
|
| 506 | 506 | if (sizeof($dev_competency_data) > 0) |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | 'job_max_level', 'start_date', 'open_date', 'close_date', 'department', 'branch', 'division', 'location_province', 'location_city', |
| 595 | 595 | 'remuneration_range_low','remuneration_range_high','impact','key_tasks','core_competencies','dev_competencies', |
| 596 | 596 | 'classification', 'security_clearance','language_requirement' |
| 597 | - )); |
|
| 597 | + )); |
|
| 598 | 598 | $jobPosters = $sql->fetchAll(); |
| 599 | 599 | //var_dump($rows); |
| 600 | 600 | } catch (PDOException $e) {
|
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | class AuthenticationDAO extends BaseDAO {
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * |
|
| 28 | - * @param type $email_address |
|
| 29 | - * @param type $password |
|
| 30 | - * @return type |
|
| 31 | - */ |
|
| 32 | - public static function authenticateUser($email_address, $password) {
|
|
| 26 | + /** |
|
| 27 | + * |
|
| 28 | + * @param type $email_address |
|
| 29 | + * @param type $password |
|
| 30 | + * @return type |
|
| 31 | + */ |
|
| 32 | + public static function authenticateUser($email_address, $password) {
|
|
| 33 | 33 | |
| 34 | 34 | $md5_password = md5($password); |
| 35 | 35 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | BaseDAO::closeConnection($link); |
| 58 | 58 | return $row; |
| 59 | - } |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | 61 | public static function storeAuthToken($token, User $authUser){
|
| 62 | 62 | |
@@ -9,32 +9,32 @@ discard block |
||
| 9 | 9 | session_start(); |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | - require_once '../config/db.config.inc'; |
|
| 12 | + require_once '../config/db.config.inc'; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Summary: Database connection manager class |
|
| 16 | - * |
|
| 17 | - */ |
|
| 18 | - abstract class BaseDAO { |
|
| 14 | + /** |
|
| 15 | + * Summary: Database connection manager class |
|
| 16 | + * |
|
| 17 | + */ |
|
| 18 | + abstract class BaseDAO { |
|
| 19 | 19 | |
| 20 | - protected function __construct() { |
|
| 20 | + protected function __construct() { |
|
| 21 | 21 | |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Summary: Prepares the connection to the database for the call using global params from the db.config.inc |
|
| 26 | - * |
|
| 27 | - * @see db.config.inc |
|
| 28 | - * |
|
| 29 | - * @link http://php.net/manual/en/pdo.construct.php |
|
| 30 | - * @param global $dbhost |
|
| 31 | - * @param global $dbname |
|
| 32 | - * @param global $dbusername |
|
| 33 | - * @param global $dbpassword |
|
| 34 | - * |
|
| 35 | - * @return $link |
|
| 36 | - */ |
|
| 37 | - protected static function getConnection() { |
|
| 24 | + /** |
|
| 25 | + * Summary: Prepares the connection to the database for the call using global params from the db.config.inc |
|
| 26 | + * |
|
| 27 | + * @see db.config.inc |
|
| 28 | + * |
|
| 29 | + * @link http://php.net/manual/en/pdo.construct.php |
|
| 30 | + * @param global $dbhost |
|
| 31 | + * @param global $dbname |
|
| 32 | + * @param global $dbusername |
|
| 33 | + * @param global $dbpassword |
|
| 34 | + * |
|
| 35 | + * @return $link |
|
| 36 | + */ |
|
| 37 | + protected static function getConnection() { |
|
| 38 | 38 | $dbhost = HOST; |
| 39 | 39 | $dbusername = USERNAME; |
| 40 | 40 | $dbpassword = PASSWORD; |
@@ -50,36 +50,36 @@ discard block |
||
| 50 | 50 | }catch(PDOException $e){ |
| 51 | 51 | die('<b>Error:</b> '.$e->getMessage()); |
| 52 | 52 | } |
| 53 | - } |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Summary: Closes the database connection for the provided $link. |
|
| 57 | - * |
|
| 58 | - * |
|
| 59 | - * @param dbconnection $link |
|
| 60 | - * $link is the connection required to be closed |
|
| 61 | - */ |
|
| 62 | - protected static function closeConnection($link){ |
|
| 55 | + /** |
|
| 56 | + * Summary: Closes the database connection for the provided $link. |
|
| 57 | + * |
|
| 58 | + * |
|
| 59 | + * @param dbconnection $link |
|
| 60 | + * $link is the connection required to be closed |
|
| 61 | + */ |
|
| 62 | + protected static function closeConnection($link){ |
|
| 63 | 63 | $link = null; |
| 64 | - } |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Summary: transactional execution of any sql string |
|
| 68 | - * @param type $link |
|
| 69 | - * @param type $sql |
|
| 70 | - * @return type |
|
| 71 | - */ |
|
| 72 | - protected static function executeDBTransaction($link,$sql){ |
|
| 73 | - try{ |
|
| 74 | - $link->beginTransaction(); |
|
| 75 | - $link->exec($sql); |
|
| 76 | - $link->commit(); |
|
| 77 | - } catch (Exception $e) { |
|
| 78 | - $link->rollBack(); |
|
| 79 | - die('<b>Error:</b> '.$e->getMessage()); |
|
| 80 | - } |
|
| 81 | - return $link; |
|
| 82 | - } |
|
| 66 | + /** |
|
| 67 | + * Summary: transactional execution of any sql string |
|
| 68 | + * @param type $link |
|
| 69 | + * @param type $sql |
|
| 70 | + * @return type |
|
| 71 | + */ |
|
| 72 | + protected static function executeDBTransaction($link,$sql){ |
|
| 73 | + try{ |
|
| 74 | + $link->beginTransaction(); |
|
| 75 | + $link->exec($sql); |
|
| 76 | + $link->commit(); |
|
| 77 | + } catch (Exception $e) { |
|
| 78 | + $link->rollBack(); |
|
| 79 | + die('<b>Error:</b> '.$e->getMessage()); |
|
| 80 | + } |
|
| 81 | + return $link; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - } |
|
| 84 | + } |
|
| 85 | 85 | ?> |
| 86 | 86 | \ No newline at end of file |
@@ -307,7 +307,7 @@ |
||
| 307 | 307 | |
| 308 | 308 | $link = BaseDAO::getConnection(); |
| 309 | 309 | |
| 310 | - //Build bulk insert sql strings for array data |
|
| 310 | + //Build bulk insert sql strings for array data |
|
| 311 | 311 | $values = []; |
| 312 | 312 | $valueStrings = []; |
| 313 | 313 | foreach($applicationQuestionAnswers as $questionAnswer) { |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @param ApplicationWorkSample[] $workSamples |
| 33 | 33 | */ |
| 34 | 34 | public static function getWorkSamplesForJobApplication($jobPosterApplicationId, $locale) { |
| 35 | - $link = BaseDAO::getConnection(); |
|
| 35 | + $link = BaseDAO::getConnection(); |
|
| 36 | 36 | |
| 37 | 37 | $sqlStr = " |
| 38 | 38 | SELECT |
@@ -426,7 +426,7 @@ |
||
| 426 | 426 | $sql->bindValue(":manager_profile_id", $managerProfileId, PDO::PARAM_INT); |
| 427 | 427 | $sql->bindValue(":work_environment_id", $workEnvironmentId, PDO::PARAM_INT); |
| 428 | 428 | |
| 429 | - try { |
|
| 429 | + try { |
|
| 430 | 430 | $sql->execute() or die("ERROR: " . implode(":", $link->errorInfo())); |
| 431 | 431 | $rowsModified = $sql->rowCount(); |
| 432 | 432 | } catch (PDOException $e) { |
@@ -179,11 +179,11 @@ |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | - * |
|
| 183 | - * @param ManagerProfile $managerProfile |
|
| 184 | - * @param ManagerProfileDetails $managerProfileDetails |
|
| 185 | - * @return int $profileId |
|
| 186 | - */ |
|
| 182 | + * |
|
| 183 | + * @param ManagerProfile $managerProfile |
|
| 184 | + * @param ManagerProfileDetails $managerProfileDetails |
|
| 185 | + * @return int $profileId |
|
| 186 | + */ |
|
| 187 | 187 | public static function updateManagerProfile(ManagerProfile $managerProfile, ManagerProfileDetailsNonLocalized $managerProfileDetails){ |
| 188 | 188 | |
| 189 | 189 | //var_dump($managerProfile->getUser_manager_profile_id()); |