Example #1
0
    /**
    * Context is not used.
    */
    function display($context)
    {
        echo $this->pageHeader("Log out & end session", "logout");
        ?>
<p>We appreciate your help in freeing up disk space for other users.
By clicking the button below, you will <b>permanently delete</b> all the files you generated during this session.
Before logging out, you may wish to
<a href='<?php 
        echo makeEventURL('onGoto', 'file_browser.php');
        ?>
'>download</a>
some of your files.
It is also possible to 
<a href='<?php 
        echo makeEventURL('onGoto', 'save_session.php');
        ?>
'>save this session</a>
and return to do more work with these files later.

<p><form method="post" action="logout_destroy.php">
<?php 
        echo postSessionID();
        ?>
<input type="hidden" name="confirm" value="1">
<br>This action cannot be undone:
<input type="submit" name="cmd" value="Destroy all my files and log me out &gt;">
</form>
<?php 
        echo $this->pageFooter();
    }
Example #2
0
/**
* Returns a string like
*   <form method='post' enctype='multipart/form-data' action='index.php'>
*   <input type='hidden' name='session' value='123ABC'>
*   <input type='hidden' name='eventID' value='456789'>
*/
function makeEventForm($funcName)
{
    $funcArgs = func_get_args();
    array_shift($funcArgs);
    // remove $funcName
    $id = addEventHandler($funcName, $funcArgs);
    $s = "<form method='post' ";
    // This is needed for forms that have file uploads,
    // but it doesn't do any harm for other forms (?)
    $s .= "enctype='multipart/form-data' ";
    // Better to do this via the button's onclick= handler
    //if($onSubmit)       $s .= "onsubmit='return $onSubmit' ";
    // What's the difference b/t this and $_SERVER[SCRIPT_NAME] ? None I can see.
    // We use basename() to get "index.php" instead of the full path,
    // which is subject to corruption with URL forwarding thru kinemage.
    $s .= "action='" . basename($_SERVER['PHP_SELF']) . "'>\n";
    $s .= postSessionID();
    $s .= "<input type='hidden' name='eventID' value='{$id}'>\n";
    return $s;
}