- Timestamp:
- 10/01/08 07:40:30 (2 months ago)
- Location:
- events/phpframework/plain_php/trunk/action
- Files:
-
- 6 added
- 1 removed
- 7 modified
-
AcountCreateAction.php (modified) (3 diffs)
-
AcountSettingsAction.php (modified) (1 diff)
-
FollowAction.php (added)
-
FriendRequestAction.php (deleted)
-
FriendsAction.php (modified) (1 diff)
-
PublicTimelineRssAction.php (added)
-
RemoveAction.php (added)
-
RequestHandleAction.php (added)
-
StatusUpdateAction.php (modified) (2 diffs)
-
StatusUpdateAjaxAction.php (added)
-
StatusesAction.php (modified) (1 diff)
-
UserAction.php (modified) (1 diff)
-
UserFriendsAction.php (modified) (1 diff)
-
UserRssAction.php (added)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/plain_php/trunk/action/AcountCreateAction.php
r20039 r20337 19 19 } 20 20 21 if ( empty($email)) {22 $t->addMessage(' メールアドレスが空です。');21 if (strlen($user_name) < 5) { 22 $t->addMessage('ユーザー名は最低5文字以上入力してください。'); 23 23 return $t; 24 24 } 25 26 if (empty($password)) {27 $t->addMessage('パスワードが空です。');28 return $t;29 }30 31 if (strlen($password) < 6) {32 $t->addMessage('パスワードは最低六文字以上入力してください。');33 return $t;34 }35 36 25 37 26 if (in_array($user_name, … … 53 42 } 54 43 44 if (empty($email)) { 45 $t->addMessage('メールアドレスが空です。'); 46 return $t; 47 } 48 55 49 if (!preg_match('/^([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i', $email)) { 56 50 $t->addMessage('不正なメールアドレスです。'); … … 58 52 } 59 53 54 if (empty($password)) { 55 $t->addMessage('パスワードが空です。'); 56 return $t; 57 } 58 59 if (strlen($password) < 6) { 60 $t->addMessage('パスワードは最低6文字以上入力してください。'); 61 return $t; 62 } 63 64 65 66 60 67 $token = md5($user_name . (string)time()); 61 68 $this->getAcountService()->insert($user_name, $email, $password, $token); 69 70 $activate_url = $this->baseUrl . '/activate/' . $token; 71 send_mail($email, 'Phwittrへようこそ!', 72 'ようこそ! ' . $user_name . ' 73 74 下のリンクで ' . $user_name . 'のアカウントを有効にしてください。 75 ' . $activate_url . ' 76 77 それでは 78 Phwittr', 79 $this->getConfig()->mail_from); 62 80 63 81 $t->setTemplateName('acount_create'); -
events/phpframework/plain_php/trunk/action/AcountSettingsAction.php
r20039 r20337 44 44 $as = $this->getAcountService(); 45 45 $as->updateEmail($session->user_id, $email); 46 if ($t->user['private_flag'] !== $private_flag) 47 $private_flag ? $as->setPrivate($session->user_id) : $as->setPublic($session->user_id); 48 46 if ($t->user['private_flag'] !== $private_flag) { 47 if (!$private_flag) { 48 $result = $as->setPublic($session->user_id); 49 } else { 50 $result = $as->setPrivate($session->user_id); 51 } 52 } 53 $t->user = $this->getAcountService()->fetchByID($session->user_id); 54 49 55 $t->addMessage('設定を保存しました'); 50 56 return $t; -
events/phpframework/plain_php/trunk/action/FriendsAction.php
r20039 r20337 13 13 $r = new TemplateResponse('followings'); 14 14 $r->user_name = $session->user_name; 15 $r->session = $session; 15 16 $r->page = intval($this->req->GET('page', 0)); 16 17 if ($r->page < 0) $r->page = 0; -
events/phpframework/plain_php/trunk/action/StatusUpdateAction.php
r20039 r20337 13 13 $url = $this->req->HTTP_REFERER; 14 14 $comment = $this->req->POST('comment', ''); 15 // @todo このへん上位モデルを作っておくべきか 15 16 16 if (preg_match('#^@([[:word:]]{1,30})#', $comment, $matches)) { 17 17 $reply_user = $this->getAcountService()->fetchByUserName($matches[1]); … … 26 26 $this->getStatusService()->reply($this->getSession()->user_id, $comment, $reply_user_id); 27 27 28 throw new RedirectResponse($ url);28 throw new RedirectResponse($this->baseUrl . '/home'); 29 29 } 30 30 } -
events/phpframework/plain_php/trunk/action/StatusesAction.php
r20039 r20337 8 8 9 9 $st = $this->getStatusService()->fetch($this->args[0]) or raise(new NotFoundResponse); 10 $st['title_comment'] = h($st['comment']);11 $st['comment'] = preg_replace('#@([[:word:]]{1,30})#',12 '@<a href="' . $this->baseUrl . '/$1">$1</a>',13 h($st['comment']));14 10 $t->status = $st; 15 11 $t->session = $this->getSession(); -
events/phpframework/plain_php/trunk/action/UserAction.php
r20039 r20337 35 35 $r->follower_count = $fs->fetchFollowerCount($user['id']); 36 36 37 if ($r->is_logined) { 38 $r->is_self = $is_self = $r->session->user_id === $user['id']; 39 $r->is_following = $is_self || $fs->isFollowing($r->session->user_id, $user['id']); 40 $r->is_requesting = !$is_self && $fs->isRequesting($r->session->user_id, $user['id']); 41 $r->is_requesting_self = !$is_self && $fs->isRequesting($user['id'], $r->session->user_id); 42 } 43 37 44 return $r; 38 45 } -
events/phpframework/plain_php/trunk/action/UserFriendsAction.php
r20039 r20337 14 14 $r = new TemplateResponse('user_followings'); 15 15 $r->user = $user; 16 $r->session = $this->getSession(); 16 17 $r->user_name = $user['user_name']; 17 18 $r->page = intval($this->req->GET('page', 0));
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)