@@ -128,26 +128,26 @@ discard block |
||
| 128 | 128 | public function getTitleNames() |
| 129 | 129 | { |
| 130 | 130 | $titles = $this->getTitles(); |
| 131 | - if($titles === false) |
|
| 131 | + if ($titles === false) |
|
| 132 | 132 | { |
| 133 | 133 | return false; |
| 134 | 134 | } |
| 135 | - if(self::$titlenames === null) |
|
| 135 | + if (self::$titlenames === null) |
|
| 136 | 136 | { |
| 137 | 137 | $dataSet = \DataSetFactory::getDataSetByName('profiles'); |
| 138 | 138 | $dataTable = $dataSet['position']; |
| 139 | 139 | $titlenames = $dataTable->read(); |
| 140 | 140 | self::$titlenames = array(); |
| 141 | 141 | $count = count($titlenames); |
| 142 | - for($i = 0; $i < $count; $i++) |
|
| 142 | + for ($i = 0; $i < $count; $i++) |
|
| 143 | 143 | { |
| 144 | 144 | self::$titlenames[$titlenames[$i]['short_name']] = $titlenames[$i]; |
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | $count = count($titles); |
| 148 | - for($i = 0; $i < $count; $i++) |
|
| 148 | + for ($i = 0; $i < $count; $i++) |
|
| 149 | 149 | { |
| 150 | - if(isset(self::$titlenames[$titles[$i]])) |
|
| 150 | + if (isset(self::$titlenames[$titles[$i]])) |
|
| 151 | 151 | { |
| 152 | 152 | $title = self::$titlenames[$titles[$i]]; |
| 153 | 153 | $titles[$i] = $title['name']; |
@@ -280,11 +280,11 @@ discard block |
||
| 280 | 280 | public function canLoginWith($provider) |
| 281 | 281 | { |
| 282 | 282 | $hosts = $this->getLoginProviders(); |
| 283 | - if($hosts === false) return false; |
|
| 283 | + if ($hosts === false) return false; |
|
| 284 | 284 | $count = count($hosts); |
| 285 | - for($i = 0; $i < $count; $i++) |
|
| 285 | + for ($i = 0; $i < $count; $i++) |
|
| 286 | 286 | { |
| 287 | - if(strcasecmp($hosts[$i], $provider) === 0) return true; |
|
| 287 | + if (strcasecmp($hosts[$i], $provider) === 0) return true; |
|
| 288 | 288 | } |
| 289 | 289 | return false; |
| 290 | 290 | } |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function isProfileComplete() |
| 310 | 310 | { |
| 311 | - if($this->getCountry() === false || $this->getAddress() === false || |
|
| 311 | + if ($this->getCountry() === false || $this->getAddress() === false || |
|
| 312 | 312 | $this->getPostalCode() === false || $this->getCity() === false || |
| 313 | - $this->getState() === false || $this->getPhoneNumber() === false) |
|
| 313 | + $this->getState() === false || $this->getPhoneNumber() === false) |
|
| 314 | 314 | { |
| 315 | 315 | return false; |
| 316 | 316 | } |
@@ -354,17 +354,17 @@ discard block |
||
| 354 | 354 | * |
| 355 | 355 | * @return true|false true if the user's password was changed, false otherwise |
| 356 | 356 | */ |
| 357 | - public function change_pass($oldpass, $newpass, $isHash=false) |
|
| 357 | + public function change_pass($oldpass, $newpass, $isHash = false) |
|
| 358 | 358 | { |
| 359 | - if($isHash === false && $this->validate_password($oldpass) === false) |
|
| 359 | + if ($isHash === false && $this->validate_password($oldpass) === false) |
|
| 360 | 360 | { |
| 361 | 361 | throw new \Exception('Invalid Password!', 3); |
| 362 | 362 | } |
| 363 | - if($isHash === true && $this->validate_reset_hash($oldpass) === false) |
|
| 363 | + if ($isHash === true && $this->validate_reset_hash($oldpass) === false) |
|
| 364 | 364 | { |
| 365 | 365 | throw new \Exception('Invalid Reset Hash!', 3); |
| 366 | 366 | } |
| 367 | - if($this->setPass($newpass) === false) |
|
| 367 | + if ($this->setPass($newpass) === false) |
|
| 368 | 368 | { |
| 369 | 369 | throw new \Exception('Unable to set password!', 6); |
| 370 | 370 | } |
@@ -602,99 +602,99 @@ discard block |
||
| 602 | 602 | $auth = \AuthProvider::getInstance(); |
| 603 | 603 | $ldap = $auth->getAuthenticator('Auth\LDAPAuthenticator'); |
| 604 | 604 | $ldap->get_and_bind_server(true); |
| 605 | - if(isset($data->oldpass) && isset($data->password)) |
|
| 605 | + if (isset($data->oldpass) && isset($data->password)) |
|
| 606 | 606 | { |
| 607 | 607 | $this->change_pass($data->oldpass, $data->password); |
| 608 | 608 | unset($data->oldpass); |
| 609 | 609 | unset($data->password); |
| 610 | 610 | } |
| 611 | - else if(isset($data->hash) && isset($data->password)) |
|
| 611 | + else if (isset($data->hash) && isset($data->password)) |
|
| 612 | 612 | { |
| 613 | 613 | $this->change_pass($data->hash, $data->password, true); |
| 614 | 614 | return; |
| 615 | 615 | } |
| 616 | - if(isset($data->displayName)) |
|
| 616 | + if (isset($data->displayName)) |
|
| 617 | 617 | { |
| 618 | 618 | $this->setDisplayName($data->displayName); |
| 619 | 619 | unset($data->displayName); |
| 620 | 620 | } |
| 621 | - if(isset($data->givenName)) |
|
| 621 | + if (isset($data->givenName)) |
|
| 622 | 622 | { |
| 623 | 623 | $this->setGivenName($data->givenName); |
| 624 | 624 | unset($data->givenName); |
| 625 | 625 | } |
| 626 | - if(isset($data->jpegPhoto)) |
|
| 626 | + if (isset($data->jpegPhoto)) |
|
| 627 | 627 | { |
| 628 | 628 | $this->setPhoto(base64_decode($data->jpegPhoto)); |
| 629 | 629 | unset($data->jpegPhoto); |
| 630 | 630 | } |
| 631 | - if(isset($data->mail)) |
|
| 631 | + if (isset($data->mail)) |
|
| 632 | 632 | { |
| 633 | - if($data->mail !== $this->getEmail()) |
|
| 633 | + if ($data->mail !== $this->getEmail()) |
|
| 634 | 634 | { |
| 635 | 635 | throw new \Exception('Unable to change email!'); |
| 636 | 636 | } |
| 637 | 637 | unset($data->mail); |
| 638 | 638 | } |
| 639 | - if(isset($data->uid)) |
|
| 639 | + if (isset($data->uid)) |
|
| 640 | 640 | { |
| 641 | - if($data->uid !== $this->getUid()) |
|
| 641 | + if ($data->uid !== $this->getUid()) |
|
| 642 | 642 | { |
| 643 | 643 | throw new \Exception('Unable to change uid!'); |
| 644 | 644 | } |
| 645 | 645 | unset($data->uid); |
| 646 | 646 | } |
| 647 | - if(isset($data->mobile)) |
|
| 647 | + if (isset($data->mobile)) |
|
| 648 | 648 | { |
| 649 | 649 | $this->setPhoneNumber($data->mobile); |
| 650 | 650 | unset($data->mobile); |
| 651 | 651 | } |
| 652 | - if(isset($data->o)) |
|
| 652 | + if (isset($data->o)) |
|
| 653 | 653 | { |
| 654 | 654 | $this->setOrganization($data->o); |
| 655 | 655 | unset($data->o); |
| 656 | 656 | } |
| 657 | - if(isset($data->title)) |
|
| 657 | + if (isset($data->title)) |
|
| 658 | 658 | { |
| 659 | 659 | $this->setTitles($data->title); |
| 660 | 660 | unset($data->title); |
| 661 | 661 | } |
| 662 | - if(isset($data->st)) |
|
| 662 | + if (isset($data->st)) |
|
| 663 | 663 | { |
| 664 | 664 | $this->setState($data->st); |
| 665 | 665 | unset($data->st); |
| 666 | 666 | } |
| 667 | - if(isset($data->l)) |
|
| 667 | + if (isset($data->l)) |
|
| 668 | 668 | { |
| 669 | 669 | $this->setCity($data->l); |
| 670 | 670 | unset($data->l); |
| 671 | 671 | } |
| 672 | - if(isset($data->sn)) |
|
| 672 | + if (isset($data->sn)) |
|
| 673 | 673 | { |
| 674 | 674 | $this->setLastName($data->sn); |
| 675 | 675 | unset($data->sn); |
| 676 | 676 | } |
| 677 | - if(isset($data->cn)) |
|
| 677 | + if (isset($data->cn)) |
|
| 678 | 678 | { |
| 679 | 679 | $this->setNickName($data->cn); |
| 680 | 680 | unset($data->cn); |
| 681 | 681 | } |
| 682 | - if(isset($data->postalAddress)) |
|
| 682 | + if (isset($data->postalAddress)) |
|
| 683 | 683 | { |
| 684 | 684 | $this->setAddress($data->postalAddress); |
| 685 | 685 | unset($data->postalAddress); |
| 686 | 686 | } |
| 687 | - if(isset($data->postalCode)) |
|
| 687 | + if (isset($data->postalCode)) |
|
| 688 | 688 | { |
| 689 | 689 | $this->setPostalCode($data->postalCode); |
| 690 | 690 | unset($data->postalCode); |
| 691 | 691 | } |
| 692 | - if(isset($data->c)) |
|
| 692 | + if (isset($data->c)) |
|
| 693 | 693 | { |
| 694 | 694 | $this->setCountry($data->c); |
| 695 | 695 | unset($data->c); |
| 696 | 696 | } |
| 697 | - if(isset($data->ou)) |
|
| 697 | + if (isset($data->ou)) |
|
| 698 | 698 | { |
| 699 | 699 | $this->setOrganizationUnits($data->ou); |
| 700 | 700 | unset($data->ou); |
@@ -749,13 +749,13 @@ discard block |
||
| 749 | 749 | public function getVcard() |
| 750 | 750 | { |
| 751 | 751 | $ret = "BEGIN:VCARD\nVERSION:2.1\n"; |
| 752 | - $ret.= 'N:'.$this->getLastName().';'.$this->getGivenName()."\n"; |
|
| 753 | - $ret.= 'FN:'.$this->getGivenName()."\n"; |
|
| 754 | - $ret.= 'TITLE:'.implode(',', $this->getTitles())."\n"; |
|
| 755 | - $ret.= "ORG: Austin Artistic Reconstruction\n"; |
|
| 756 | - $ret.= 'TEL;TYPE=MOBILE,VOICE:'.$this->getPhoneNumber()."\n"; |
|
| 757 | - $ret.= 'EMAIL;TYPE=PREF,INTERNET:'.$this->getEmail()."\n"; |
|
| 758 | - $ret.= "END:VCARD\n"; |
|
| 752 | + $ret .= 'N:'.$this->getLastName().';'.$this->getGivenName()."\n"; |
|
| 753 | + $ret .= 'FN:'.$this->getGivenName()."\n"; |
|
| 754 | + $ret .= 'TITLE:'.implode(',', $this->getTitles())."\n"; |
|
| 755 | + $ret .= "ORG: Austin Artistic Reconstruction\n"; |
|
| 756 | + $ret .= 'TEL;TYPE=MOBILE,VOICE:'.$this->getPhoneNumber()."\n"; |
|
| 757 | + $ret .= 'EMAIL;TYPE=PREF,INTERNET:'.$this->getEmail()."\n"; |
|
| 758 | + $ret .= "END:VCARD\n"; |
|
| 759 | 759 | return $ret; |
| 760 | 760 | } |
| 761 | 761 | } |