+<?php
+/**
+ * FSF Member Dashboard
+ * Copyright © 2014 Free Software Foundation, Inc.
+ *
+ * This file is a part of FSF Member Dashboard.
+ *
+ * FSF Member Dashboard is free software; you can copy, modify, and
+ * distribute it under the terms of the GNU Affero General Public
+ * License Version 3, 19 November 2007 and the CiviCRM Licensing
+ * Exception.
+ *
+ * FSF Member Dashboard is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FSF Member Dashboard. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+require_once 'CRM/Core/Page.php';
+
+class CRM_Memberdashboard_Page extends CRM_Core_Page {
+ public $contact = NULL;
+
+ function __construct() {
+ parent::__construct();
+
+ $this->contact = $this->loadContact();
+ }
+
+ function contactId() {
+ return CRM_Core_Session::singleton()->get('userID');
+ }
+
+ /**
+ * Return a contact object for the current user.
+ *
+ * @return CRM_Contact
+ */
+ function loadContact() {
+ return civicrm_api3('contact', 'getsingle', array(
+ 'id' => $this->contactId()
+ ));
+ }
+
+ function isPOST() {
+ return $_SERVER['REQUEST_METHOD'] == 'POST';
+ }
+}