OSDN Git Service

add ACS webapp, sql, htdocs
[acs/acs.git] / webapp / modules / System / actions / SystemAnnounceListAction.class.php
diff --git a/webapp/modules/System/actions/SystemAnnounceListAction.class.php b/webapp/modules/System/actions/SystemAnnounceListAction.class.php
new file mode 100644 (file)
index 0000000..1d7f12b
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+// $Id: SystemAnnounceListAction.class.php,v 1.1 2006/06/13 02:49:43 w-ota Exp $
+
+class SystemAnnounceListAction extends BaseAction
+{
+       // GET
+       function execute() {
+               $context = $this->getContext();
+               $controller = $context->getController();
+               $request = $context->getRequest();
+               $user = $context->getUser();
+
+               // ´ÉÍý¼Ô¤«¤É¤¦¤«³Îǧ
+               if (!$this->get_execute_privilege()) {
+                       $controller->forward(SECURE_MODULE, SECURE_ACTION);
+                       return;
+               }
+               
+               $acs_user_info_row = $user->getAttribute('acs_user_info_row');
+
+               // ¥·¥¹¥Æ¥à¥¢¥Ê¥¦¥ó¥¹¾ðÊó°ìÍ÷
+               $system_announce_row_array = ACSSystemAnnounce::get_all_system_announce_row_array();
+
+               // set
+               $request->setAttribute('system_announce_row_array', $system_announce_row_array);
+
+               return View::SUCCESS;
+       }
+
+       function isSecure() {
+               return false;
+       }
+
+       function getCredential() {
+               return array('SYSTEM_ADMIN_USER');
+       }
+
+       function get_execute_privilege () {
+               $context = $this->getContext();
+               $user = $context->getUser();
+
+               // ´ÉÍý¼Ô¤Î¾ì¹ç¤ÏOK
+               if ($user->hasCredential('SYSTEM_ADMIN_USER')) {
+                       return true;
+               }
+               return false;
+       }
+}
+
+?>