Changeset 52
- Timestamp:
- 10/28/07 10:06:36 (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
server.common.php (modified) (1 diff)
-
server.service.php (modified) (22 diffs)
-
server.user.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/server.common.php
r46 r52 22 22 23 23 $database = new DatabaseConnection(); 24 $user = new User();25 24 26 25 function generateRandomString($size = 32) { -
trunk/server.service.php
r46 r52 33 33 34 34 function gettasks($start = 0, $end = 0) { 35 global $database, $user; 35 global $database; 36 37 $user = User::getInstance(); 36 38 37 39 // Wurde kein Beginn des Zeitrahmens angegeben, wird der aktuelle Tag eingesetzt … … 106 108 107 109 function removetask($taskid) { 108 global $database, $user; 110 global $database; 111 112 $user = User::getInstance(); 109 113 110 114 if (!$user->authenticated) { … … 128 132 129 133 function createtask($subject, $date, $text, $important = false) { 130 global $database, $user; 134 global $database; 135 136 $user = User::getInstance(); 131 137 132 138 // Prüft, ob der Benuzter angemeldet ist … … 161 167 162 168 function edittask($id, $date, $text, $important = false) { 163 global $database, $user; 169 global $database; 170 171 $user = User::getInstance(); 164 172 165 173 // Prüft, ob der Benuzter angemeldet ist … … 190 198 191 199 function getcomments($taskid) { 192 global $database, $user; 200 global $database; 201 202 $user = User::getInstance(); 193 203 194 204 $databaseResponse = $database->query("SELECT * FROM comments WHERE taskid = " . mySQLValue($taskid) . " ORDER BY date"); … … 228 238 229 239 function createcomment($taskid, $text) { 230 global $database, $user; 240 global $database; 241 242 $user = User::getInstance(); 231 243 232 244 if (!$user->authenticated) { … … 251 263 252 264 function editcomment($id, $text) { 253 global $database, $user; 265 global $database; 266 267 $user = User::getInstance(); 254 268 255 269 if (!$text) { … … 277 291 278 292 function getcontacts() { 279 global $database, $user; 293 global $database; 294 295 $user = User::getInstance(); 280 296 281 297 $databaseResponse = $database->query("SELECT * FROM users ORDER BY firstname"); … … 340 356 341 357 function archivefile($id) { 342 global $database, $user; 358 global $database; 359 360 $user = User::getInstance(); 343 361 344 362 if (!$user->authenticated) { … … 373 391 374 392 function uploadfile($description) { 375 global $database, $user; 393 global $database; 394 395 $user = User::getInstance(); 376 396 377 397 $settings = Settings::getInstance(); … … 422 442 423 443 function signin($nickname, $password) { 424 global $user;444 $user = User::getInstance(); 425 445 426 446 if (!$user->signIn($nickname, $password)) { … … 460 480 } 461 481 462 if (!mail($user["mail"], "Neues Klassenbuchpasswort bestätigen", "Hallo " . $user["firstname"] . ",\n\n" . 463 "Du hast im Klassenbuch auf www.gymo1c.ch ein neues Passwort angefordert. Klicke auf den foldenden Link, damit dein Passwort endgültig auf \"" . 464 "$password\" gewechselt wird. Wenn du kein Passwort angefordert hast, solltest du nicht auf diesen Link klicken, " . 465 "sondern diese E-Mail gleich löschen!\n\nhttp://www.gymo1c.ch/index.php?passwordverification=$requestKey\n\nLg, Seve", 482 if (!mail($user["mail"], "Neues Klassenbuchpasswort bestätigen", 483 "Hallo " . $user["firstname"] . ",\n\n" . 484 "Du hast im Klassenbuch auf www.gymo1c.ch ein neues Passwort angefordert. Klicke auf den foldenden Link, " . 485 "damit dein Passwort endgültig auf \"$password\" gewechselt wird. Wenn du kein Passwort angefordert hast, " . 486 "solltest du nicht auf diesen Link klicken, sondern diese E-Mail gleich löschen!\n\n" . 487 $settings->domain . "?passwordverification=$requestKey", 466 488 "From: Klassenbuch <no-reply@gymo1c.ch>")) { 467 489 return WebServiceError("invalid_input"); … … 499 521 500 522 function changepassword($newpassword, $currentpassword) { 501 global $database, $user; 523 global $database; 524 525 $user = User::getInstance(); 502 526 503 527 if (!$user->authenticated) { … … 524 548 525 549 function getuserdata() { 526 global $user;550 $user = User::getInstance(); 527 551 528 552 if (!$user->authenticated) { … … 541 565 542 566 function updateuserprofile($profileInformation) { 543 global $user;567 $user = User::getInstance(); 544 568 545 569 if (!$user->authenticated) { … … 555 579 556 580 function changeusersettings($settings) { 557 global $user;581 $user = User::getInstance(); 558 582 559 583 if (!$user->authenticated) { … … 572 596 573 597 function signout() { 574 global $user;598 $user = User::getInstance(); 575 599 576 600 return $user->signOut(); … … 654 678 655 679 function gallery_createalbum($name, $description = "") { 656 global $database, $user; 680 global $database; 681 682 $user = User::getInstance(); 657 683 658 684 $name = trim(smartStripSlashes($name)); … … 676 702 677 703 function gallery_removealbum($id) { 678 global $database, $user; 704 global $database; 705 706 $user = User::getInstance(); 679 707 680 708 $id = intval($id); … … 694 722 695 723 function gallery_downloadalbum($albumid) { 696 global $database, $user; 724 global $database; 725 726 $user = User::getInstance(); 697 727 698 728 $albumid = intval($albumid); … … 774 804 775 805 function gallery_uploadpicture($albumid) { 776 global $database, $user; 806 global $database; 807 808 $user = User::getInstance(); 777 809 778 810 if (!$user->authenticated) { … … 846 878 847 879 function gallery_rotatepicture($pictureid, $degree) { 848 global $user, $database; 880 global $database; 881 882 $user = User::getInstance(); 849 883 850 884 $pictureid = intval($pictureid); -
trunk/server.user.php
r24 r52 41 41 } 42 42 43 p ublicfunction __construct() {43 private function __construct() { 44 44 $this->_secureSession = true; 45 45 $this->authenticated = false; … … 71 71 72 72 public function authenticate() { 73 if ($this->authenticated ) {74 return true;75 }76 77 if ($this->authenticateBySession()) {73 if ($this->authenticated || 74 $this->authenticateBySession() || 75 $this->authenticateByCookie() || 76 $this->authenticateByJSONRPCRequest() || 77 $this->authenticateByPOSTParams()) { 78 78 $this->authenticated = true; 79 79 return true; 80 80 } 81 81 82 if ($this->authenticateByCookie()) {83 $this->authenticated = true;84 return true;85 }86 87 if ($this->authenticateByJSONRPCRequest()) {88 $this->authenticated = true;89 return true;90 }91 92 if ($this->authenticateByPOSTParams()) {93 $this->authenticated = true;94 return true;95 }96 97 82 return false; 98 83 } … … 101 86 $this->setupSession(); 102 87 103 // $this->_secureSession->Check() 88 if (!$this->_secureSession->Check()) { 89 return false; 90 } 104 91 105 92 return $this->authenticateByToken($_SESSION["userid"], $_SESSION["token"]);
Note: See TracChangeset
for help on using the changeset viewer.