--- /dev/null
+<?php
+// $Id: DeleteFriendsGroupAction.class.php,v 1.4 2006/03/28 04:38:13 kuwayama Exp $
+
+class DeleteFriendsGroupAction extends BaseAction
+{
+ // GET
+ function getDefaultView() {
+ $context = $this->getContext();
+ $controller = $context->getController();
+ $request = $context->getRequest();
+ $user = $context->getUser();
+ $acs_user_info_row = $user->getAttribute('acs_user_info_row');
+
+ // ÂоݤȤʤë¥æ¡¼¥¶¥³¥ß¥å¥Ë¥Æ¥£ID¤ò¼èÆÀ
+ $user_community_id = $request->ACSgetParameter('id');
+ // ÂоݤȤʤë¥Þ¥¤¥Õ¥ì¥ó¥º¥°¥ë¡¼¥×¥³¥ß¥å¥Ë¥Æ¥£ID¤ò¼èÆÀ
+ $friends_group_community_id = $request->ACSgetParameter('community_id');
+
+ if (!$this->get_execute_privilege()) {
+ $controller->forward(SECURE_MODULE, SECURE_ACTION);
+ return;
+ }
+
+ // get
+ // ¥æ¡¼¥¶¾ðÊó
+ $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id);
+ // »ØÄꤵ¤ì¤¿¥Þ¥¤¥Õ¥ì¥ó¥º¥°¥ë¡¼¥×¤Î¾ðÊó
+ $friends_group_row = ACSCommunity::get_community_row($friends_group_community_id);
+
+ // set
+ $request->setAttribute('target_user_info_row', $target_user_info_row);
+ $request->setAttribute('friends_group_row', $friends_group_row);
+
+ return View::INPUT;
+ }
+
+ // POST
+ function execute() {
+ $context = $this->getContext();
+ $controller = $context->getController();
+ $request = $context->getRequest();
+ $user = $context->getUser();
+
+ // ÂоݤȤʤë¥æ¡¼¥¶¥³¥ß¥å¥Ë¥Æ¥£ID¤ò¼èÆÀ
+ $user_community_id = $request->ACSgetParameter('id');
+ // ÂоݤȤʤë¥Þ¥¤¥Õ¥ì¥ó¥º¥°¥ë¡¼¥×¥³¥ß¥å¥Ë¥Æ¥£ID¤ò¼èÆÀ
+ $friends_group_community_id = $request->ACSgetParameter('community_id');
+
+ // ¹¹¿·
+ ACSUser::delete_friends_group($friends_group_community_id);
+
+ $friends_group_list_top_page_url = $this->getControllerPath('User', 'FriendsGroupList') . '&id=' . $user_community_id;
+ header("Location: $friends_group_list_top_page_url");
+ }
+
+ function getRequestMethods() {
+ return Request::POST;
+ }
+
+ function isSecure () {
+ return false;
+ }
+
+ function getCredential() {
+ return array('USER_PAGE_OWNER');
+ }
+
+ function get_execute_privilege () {
+ $context = $this->getContext();
+ $user = $context->getUser();
+
+ // Ëܿͤǡ¢LDAPǧ¾Ú°Ê³°¤Î¾ì¹ç¤ÏOK
+ if ($user->hasCredential('USER_PAGE_OWNER')) {
+ return true;
+ }
+ return false;
+ }
+}
+
+?>