<?php
	require_once( $GLOBALS["site_root"]."/includes/pages/BackendPopup.inc.php" );
	require_once( $GLOBALS["site_root"]."/includes/models/MyMember.inc.php" );

	class AdminMemberGotoPage extends BackendPopup {
		public function __construct( $id = "AdminMemberEditPage" , $parent = null ) {
			parent::__construct( $id , $parent );
			if (!AdminUserModel::isAdminLoggedIn()) return;
		}

		public function handleEvents() {
			if (!isset( $this->aG["member_id"] )) return parent::handleEvents();
			if (!isset( $this->aG["url"] )) return parent::handleEvents();
			$mym = new MyMemberModel();
			$mym->loginMember( $this->aG["member_id"] );
			FNTH_redirect( $this->aG["url"] );
			return parent::handleEvents();
		}

		public function render() {
			return "unavailable";
		}
	}

?>
