public function content()
 {
     if (isset($_GET['user_id'])) {
         $user_id = $_GET['user_id'];
     } else {
         $user_id = Oedipus_LogInHelper::get_current_user_id();
     }
     $user = Oedipus_UsersHelper::get_user($user_id);
     if (Oedipus_LogInHelper::compare_user_id_to_currently_logged_in_id($user_id)) {
         echo '<h2>Your Account</h2>';
         $other_teams_heading = 'Your teams';
         echo '<p>Welcome to <em>Oedipus: Decision Maker</em>, ';
         echo stripcslashes($user['first_name'] . ' ' . $user['last_name']);
         echo "!</p>\n";
     } else {
         echo '<h2>' . stripcslashes($user['first_name'] . ' ' . $user['last_name']) . "'s Page</h2>\n";
         $other_teams_heading = 'Teams';
     }
     DBPages_PageRenderer::render_page_section('users', 'welcome');
     /*
      * Show the teams that this user already a user of.
      */
     #$team_root_url = $this->get_current_url_just_file();
     #
     #$team_root_url->set_get_variable('oo-page');
     #$team_root_url->set_get_variable('page-class', 'Oedipus_TeamPage');
 }
 public function content()
 {
     DBPages_PageRenderer::render_page_section('my-dramas', 'title');
     /*
      * Get current user
      */
     $this->user_id = Oedipus_LogInHelper::get_current_user_id();
     //                $user = Oedipus_UsersHelper::get_user($user_id);
     $drama_page_div = $this->get_my_dramas_page_div();
     echo $drama_page_div->get_as_string();
 }
 public function send_http_headers()
 {
     #session_start();
     parent::send_http_headers();
     #print_r($_SESSION); exit;
     if (Oedipus_LogInHelper::is_logged_in()) {
         Oedipus_LogInHelper::log_in(Oedipus_LogInHelper::get_current_user_id());
     } else {
         Oedipus_LogInHelper::set_desired_restricted_page_url_to_current_location();
         Oedipus_LogInHelper::redirect_to_log_in_page();
     }
     #print_r($this); exit;
 }
    public function render_body_div_account_status()
    {
        echo '<div id="account_status">' . "\n";
        if (isset($_SESSION['logged-in-id'])) {
            //
            // Why do you havve to log in again everytime?
            //
            Oedipus_LogInHelper::log_in($_SESSION['logged-in-id']);
            $user_id = Oedipus_LogInHelper::get_current_user_id();
            $user = Oedipus_UsersHelper::get_user($user_id);
            echo '<ul>';
            echo '<li>';
            echo '<a href="/Oedipus_UserPage">';
            echo stripcslashes($user['email']);
            echo '</a>';
            echo '</li>';
            echo "\n";
            ?>
<li>
<a href="/Oedipus_LogOutRequest">Log out</a>
</li>
<?php 
        } else {
            ?>
<ul>
<li>
<a href="/Oedipus_RegisterPage">Register</a>
</li>

<li>
<a href="/Oedipus_LoginPage">Log in</a>
</li>
<?php 
        }
        echo '</ul>' . "\n";
        echo '</div>' . "\n";
    }
 public function content()
 {
     /*
      * Find out if currently logged in user created the drama
      * Or has permission to view the drama
      * Or the drama is public
      */
     if (Oedipus_LogInHelper::is_logged_in()) {
         $user_id = Oedipus_LogInHelper::get_current_user_id();
         // $user = Oedipus_UsersHelper::get_user($user_id);
         if (Oedipus_UsersHelper::is_user_id_drama_creator($user_id, $this->get_drama())) {
             /*
              * Set Edit Priviliges
              */
             $this->get_drama()->make_drama_editable();
         }
         if ($this->get_drama()->is_public() || $this->get_drama()->is_editable() || Oedipus_UsersHelper::is_user_id_allowed_to_view_drama($user_id, $this->get_drama())) {
             /*
              * Render the Drama Div
              */
             $drama_div = $this->get_drama_div();
             echo $drama_div->get_as_string();
         }
     } elseif ($this->get_drama()->is_public()) {
         /*
          * Render the Drama Div
          */
         $drama_div = $this->get_drama_div();
         echo $drama_div->get_as_string();
     } else {
         /*
          *Drama creator id not same as logged in user
          */
         DBPages_PageRenderer::render_page_section('drama', 'title');
         DBPages_PageRenderer::render_page_section('drama', 'drama-unavailable');
     }
 }