00001 <?php
00002
00020
00021
00022
00023 class User extends DataObject {
00024
00025 function User() {
00026 parent::DataObject();
00027 }
00028
00029
00030
00031
00032
00037 function getUserId() {
00038 return $this->getData('userId');
00039 }
00040
00045 function setUserId($userId) {
00046 return $this->setData('userId', $userId);
00047 }
00048
00053 function getUsername() {
00054 return $this->getData('username');
00055 }
00056
00061 function setUsername($username) {
00062 return $this->setData('username', $username);
00063 }
00064
00068 function getUserSignature() {
00069 return $this->getLocalizedData('signature');
00070 }
00071
00077 function getSignature($locale) {
00078 return $this->getData('signature', $locale);
00079 }
00080
00086 function setSignature($signature, $locale) {
00087 return $this->setData('signature', $signature, $locale);
00088 }
00089
00094 function getPassword() {
00095 return $this->getData('password');
00096 }
00097
00102 function setPassword($password) {
00103 return $this->setData('password', $password);
00104 }
00105
00110 function getFirstName() {
00111 return $this->getData('firstName');
00112 }
00113
00118 function setFirstName($firstName)
00119 {
00120 return $this->setData('firstName', $firstName);
00121 }
00122
00127 function getMiddleName() {
00128 return $this->getData('middleName');
00129 }
00130
00135 function setMiddleName($middleName) {
00136 return $this->setData('middleName', $middleName);
00137 }
00138
00143 function getInitials() {
00144 return $this->getData('initials');
00145 }
00146
00151 function setInitials($initials) {
00152 return $this->setData('initials', $initials);
00153 }
00154
00159 function getLastName() {
00160 return $this->getData('lastName');
00161 }
00162
00167 function setLastName($lastName) {
00168 return $this->setData('lastName', $lastName);
00169 }
00170
00175 function getSalutation() {
00176 return $this->getData('salutation');
00177 }
00178
00183 function setSalutation($salutation) {
00184 return $this->setData('salutation', $salutation);
00185 }
00186
00191 function getGender() {
00192 return $this->getData('gender');
00193 }
00194
00199 function setGender($gender) {
00200 return $this->setData('gender', $gender);
00201 }
00202
00207 function getAffiliation() {
00208 return $this->getData('affiliation');
00209 }
00210
00215 function setAffiliation($affiliation) {
00216 return $this->setData('affiliation', $affiliation);
00217 }
00218
00223 function getEmail() {
00224 return $this->getData('email');
00225 }
00226
00231 function setEmail($email) {
00232 return $this->setData('email', $email);
00233 }
00234
00239 function getUrl() {
00240 return $this->getData('url');
00241 }
00242
00247 function setUrl($url) {
00248 return $this->setData('url', $url);
00249 }
00250
00255 function getPhone() {
00256 return $this->getData('phone');
00257 }
00258
00263 function setPhone($phone) {
00264 return $this->setData('phone', $phone);
00265 }
00266
00271 function getFax() {
00272 return $this->getData('fax');
00273 }
00274
00279 function setFax($fax) {
00280 return $this->setData('fax', $fax);
00281 }
00282
00287 function getMailingAddress() {
00288 return $this->getData('mailingAddress');
00289 }
00290
00295 function setMailingAddress($mailingAddress) {
00296 return $this->setData('mailingAddress', $mailingAddress);
00297 }
00298
00303 function getCountry() {
00304 return $this->getData('country');
00305 }
00306
00311 function setCountry($country) {
00312 return $this->setData('country', $country);
00313 }
00314
00318 function getUserBiography() {
00319 return $this->getLocalizedData('biography');
00320 }
00321
00327 function getBiography($locale) {
00328 return $this->getData('biography', $locale);
00329 }
00330
00336 function setBiography($biography, $locale) {
00337 return $this->setData('biography', $biography, $locale);
00338 }
00339
00343 function getUserInterests() {
00344 return $this->getLocalizedData('interests');
00345 }
00346
00352 function getInterests($locale) {
00353 return $this->getData('interests', $locale);
00354 }
00355
00361 function setInterests($interests, $locale) {
00362 return $this->setData('interests', $interests, $locale);
00363 }
00364
00369 function getLocales() {
00370 $locales = $this->getData('locales');
00371 return isset($locales) ? $locales : array();
00372 }
00373
00378 function setLocales($locales) {
00379 return $this->setData('locales', $locales);
00380 }
00381
00386 function getDateLastEmail() {
00387 return $this->getData('dateLastEmail');
00388 }
00389
00394 function setDateLastEmail($dateLastEmail) {
00395 return $this->setData('dateLastEmail', $dateLastEmail);
00396 }
00397
00402 function getDateRegistered() {
00403 return $this->getData('dateRegistered');
00404 }
00405
00410 function setDateRegistered($dateRegistered) {
00411 return $this->setData('dateRegistered', $dateRegistered);
00412 }
00413
00418 function getDateValidated() {
00419 return $this->getData('dateValidated');
00420 }
00421
00426 function setDateValidated($dateValidated) {
00427 return $this->setData('dateValidated', $dateValidated);
00428 }
00429
00434 function getDateLastLogin() {
00435 return $this->getData('dateLastLogin');
00436 }
00437
00442 function setDateLastLogin($dateLastLogin) {
00443 return $this->setData('dateLastLogin', $dateLastLogin);
00444 }
00445
00450 function getDateEndMembership() {
00451 return $this->getData('dateEndMembership');
00452 }
00453
00458 function setDateEndMembership($dateEndMembership) {
00459 return $this->setData('dateEndMembership', $dateEndMembership);
00460 }
00461
00466 function getMustChangePassword() {
00467 return $this->getData('mustChangePassword');
00468 }
00469
00474 function setMustChangePassword($mustChangePassword) {
00475 return $this->setData('mustChangePassword', $mustChangePassword);
00476 }
00477
00482 function getDisabled() {
00483 return $this->getData('disabled');
00484 }
00485
00490 function setDisabled($disabled) {
00491 return $this->setData('disabled', $disabled);
00492 }
00493
00498 function getDisabledReason() {
00499 return $this->getData('disabled_reason');
00500 }
00501
00506 function setDisabledReason($reasonDisabled) {
00507 return $this->setData('disabled_reason', $reasonDisabled);
00508 }
00509
00514 function getAuthId() {
00515 return $this->getData('authId');
00516 }
00517
00522 function setAuthId($authId) {
00523 return $this->setData('authId', $authId);
00524 }
00525
00530 function getAuthStr() {
00531 return $this->getData('authStr');
00532 }
00533
00538 function setAuthStr($authStr) {
00539 return $this->setData('authStr', $authStr);
00540 }
00541
00547 function &getSettings($journalId = null) {
00548 $userSettingsDao = &DAORegistry::getDAO('UserSettingsDAO');
00549 $settings = &$userSettingsDao->getSettingsByJournal($this->getData('userId'), $journalId);
00550 return $settings;
00551 }
00552
00559 function &getSetting($name, $journalId = null) {
00560 $userSettingsDao = &DAORegistry::getDAO('UserSettingsDAO');
00561 $setting = &$userSettingsDao->getSetting($this->getData('userId'), $name, $journalId);
00562 return $setting;
00563 }
00564
00571 function updateSetting($name, $value, $type = null, $journalId = null) {
00572 $userSettingsDao = &DAORegistry::getDAO('UserSettingsDAO');
00573 return $userSettingsDao->updateSetting($this->getData('userId'), $name, $value, $type, $journalId);
00574 }
00575
00582 function getFullName($lastFirst = false) {
00583 if ($lastFirst) {
00584 return $this->getData('lastName') . ', ' . $this->getData('firstName') . ($this->getData('middleName') != '' ? ' ' . $this->getData('middleName') : '');
00585
00586 } else {
00587 return $this->getData('firstName') . ' ' . ($this->getData('middleName') != '' ? $this->getData('middleName') . ' ' : '') . $this->getData('lastName');
00588 }
00589 }
00590
00591 function getContactSignature() {
00592 $signature = $this->getFullName();
00593 if ($this->getAffiliation()) $signature .= "\n" . $this->getAffiliation();
00594 if ($this->getPhone()) $signature .= "\n" . Locale::translate('user.phone') . ' ' . $this->getPhone();
00595 if ($this->getFax()) $signature .= "\n" . Locale::translate('user.fax') . ' ' . $this->getFax();
00596 $signature .= "\n" . $this->getEmail();
00597 return $signature;
00598 }
00599 }
00600 ?>