Example #1
0
    $user = User::get();
    if ($user->webview == 1) {
        $warning = new AlertText("Warning! Your plan is set to be viewable by guests. This will allow blocked users to read your plan\n            simply by logging out. If you would like to change this setting, please visit\n            <a href=\"/webview.php\">the guest settings page</a>.");
        $header->append($warning);
    }
    $about = new InfoText('Users that you have blocked will not be able to read your plan, and you will not see each other listed in quicklove or search results.
        <a href="/blocking-about.php">See the FAQ for more information</a>.
        <br /><br />
        <b>Please be aware that your activity on Notes is still visible to everyone.</b> If you feel this presents a serious problem to you, please <a href="mailto:grinnellplans@gmail.com">contact the administrators</a>.');
    $header->append($about);
    $heading = new HeadingText('Blocked Users', 2);
    $thispage->append($heading);
    $blocklist = new WidgetList('blocked_user_list', true);
    $thispage->append($blocklist);
    $q = Doctrine_Query::create()->select("*")->from("Accounts a")->innerJoin("a.BlockedBy b")->where("b.blocking_user_id = ?", $idcookie);
    $blocked_users = $q->execute();
    foreach ($blocked_users as $blocked_user) {
        $entry = new WidgetGroup('newplan', false);
        $plan = new PlanLink($blocked_user->username);
        $form = new Form('block', 'User blocking options');
        $item = new HiddenInput('unblock_user', $blocked_user->userid);
        $form->append($item);
        $item = new SubmitInput("Unblock {$blocked_user->username}");
        $form->append($item);
        $entry->append($plan);
        $entry->append($form);
        $blocklist->append($entry);
    }
}
interface_disp_page($thispage);
db_disconnect($dbh);
Example #2
0
function show_form()
{
    $form = new Form('signup', true);
    $form->method = 'GET';
    $message = new InfoText('If you have an @grinnell.edu email address for yourself or a student group, you may use this page to register a Plan for that username.<br />
	<b>If you are an alum</b>, please <a href="mailto:grinnellplans@gmail.com">Send us</a> your alumni.grinnell.edu email address and we will contact you through it with a username and password.  Please include your year of graduation, if any.<br />
	If you are somebody else, or have questions, <a href="mailto:grinnellplans@gmail.com">Ask us</a>, and we\'ll see what we can do.', 'Register your plan');
    $form->append($message);
    $instruct = new InfoText('Enter your Grinnell username below (this is the part of your email address that comes before the \'@\', and click Register.  This will send you an email with a link that will complete your account creation.', 'Email needed');
    $form->append($instruct);
    $item = new TextInput('username', null);
    $item->title = 'Grinnell email username:'******'accounttype', true);
    $acct_type->title = 'What is your relation to Grinnell?';
    $form->append($acct_type);
    */
    $group = new FormItemSet('studenttype', true);
    $form->append($group);
    $item = new RadioInput('type', 'student');
    $item->description = 'Student';
    $group->append($item);
    /*<input type="radio" name="type" value="student" onClick ="toggle('year', 0);toggle('other', 4);">*/
    $item = new TextInput('gradyear', null);
    $item->description = 'Grad Year';
    $group->append($item);
    /*<span id="year"> Grad Year: <input type="text" name="gradyear"> </span>*/
    $item = new RadioInput('type', 'staff');
    $item->description = 'Staff';
    $form->append($item);
    $item = new RadioInput('type', 'group');
    $item->description = 'Group';
    $form->append($item);
    $item = new RadioInput('type', 'faculty');
    $item->description = 'Faculty';
    $form->append($item);
    $item = new SubmitInput('Register');
    $form->append($item);
    $item = new HiddenInput('submitted', 1);
    $form->append($item);
    return $form;
}
/**
 * Gets the finger form
 *
 * This is the form that users may use to read a plan by typing a username
 *
 * @return Form
 */
function get_fingerbox()
{
    $f = new Form('finger');
    $f->action = 'read.php';
    $f->method = 'GET';
    $item = new TextInput('searchname', NULL);
    $f->append($item);
    $item = new SubmitInput('Read');
    $f->append($item);
    return $f;
}
function reset_step2()
{
    $form = new Form('reset_step2', true);
    $form->method = 'POST';
    $msg = new InfoText('Please choose a new password for your GrinnellPlans account. Passwords must be four characters long or more.', 'Choose new password');
    $form->append($msg);
    $username = new TextInput('u', $_REQUEST['u']);
    $username->title = 'Username:'******'password1');
    $pw1->title = "New Password:"******"Verify:";
    $form->append($pw2);
    $submit = new SubmitInput('Change Password');
    $form->append($submit);
    $e = new HiddenInput('e', $_REQUEST['e']);
    $form->append($e);
    $h = new HiddenInput('h', $_REQUEST['h']);
    $form->append($h);
    return $form;
}
Example #5
0
}
$infotext = "Here you can post anonymously.  This page was created to help give wgemigh";
$infotext .= " his plan back, and to make it possible to paginate an increasing number of";
$infotext .= " secrets.  Please add this page as an optional link under 'preferences'.";
$page->append(new InfoText($infotext));
$infotext2 .= "Secrets cannot be tracked by any Plans administrator.  If you're still worried,";
$infotext2 .= " you may log out before posting. We can exercise editorial discretion as to what shows up.";
$page->append(new InfoText($infotext2));
$infotext3 .= "When posting to Secrets, please remember these guidelines:\n";
$infotext3 .= "1. Your post must be a secret.\n";
$infotext3 .= "2. The secret must be your own.\n";
$infotext3 .= "3. The secret may not reference any person or group in any identifiable way.\n";
$page->append(new InfoText($infotext3));
$submitform = new Form('submitsecret', true);
$hidden = new HiddenInput('secret_submitted', 1);
$submitform->append($hidden);
$text = new TextareaInput('secret', null);
$text->rows = 10;
$text->cols = 50;
$submitform->append($text);
$submit = new SubmitInput('Post');
$submitform->append($submit);
$post_secret = new DisplayToggleLink('post_secret_toggle', true, $submitform, 'Post a Secret', 'Cancel');
$page->append($post_secret);
$page->append($submitform);
if (isset($_POST['secret_submitted'])) {
    $secret = $_POST['secret'];
    $secret = cleanText($secret);
    $secret = mysql_real_escape_string($secret);
    $sql = "insert into secrets(secret_text, date, display) values (substring('{$secret}',1,4000), now(), 'no')";
    mysql_query($sql);
Example #6
0
         $plantext = jumble($plantext);
     }
     $plantext = new PlanText($plantext, false);
     $thisplan = new PlanContent($user->username, $user->pseudo, strtotime($user->login), strtotime($user->changed), $plantext);
     $page->append($thisplan);
 }
 $page->title = '[' . $user->username . "]'s Plan";
 if (User::logged_in()) {
     if (!($searchnum == $idcookie)) {
         if (!$this_user_is_blocking_you && !$is_blocking_this_user) {
             $addform = new Form('autoreadadd', 'Set Priority');
             $thisplan->addform = $addform;
             $addform->action = "read.php?searchnum={$searchnum}";
             $addform->method = 'POST';
             $item = new HiddenInput('addtolist', 1);
             $addform->append($item);
             $levels = new FormItemSet('readadd_levels', true);
             $addform->append($levels);
             for ($j = 0; $j < 4; $j++) {
                 $item = new RadioInput('privlevel', $j);
                 if ($j == 0) {
                     $item->description = 'X';
                 } else {
                     $item->description = "{$j}";
                 }
                 $item->checked = $myonlist == $item->description;
                 $levels->append($item);
             }
             $item = new SubmitInput('Set Priority');
             $addform->append($item);
         }