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
            $user->Plan->save();
            $user->changed = new Doctrine_Expression('NOW()');
            //set the time which keeps track of when the plan was last updated
            $user->save();
            Autofinger::updateFor($idcookie);
            // Leave this page!
            Redirect('read.php?edit_submit=1&searchname=' . User::name());
            exit;
        } catch (Doctrine_Validator_Exception $e) {
            $errmsg = 'Sorry, your plan is too long. Please remove some text and try again.';
            $err = new AlertText($errmsg, 'Maximum Plan length exceeded');
            $page->append($err);
            $page->append(make_editbox($plan, $user));
        }
    }
}
//allow to edit if user
/* display the page */
interface_disp_page($page);
db_disconnect($dbh);
function make_editbox($plantext, $user, $edit_button = 1)
{
    $plan = new PlanText($plantext, true);
    $editbox = new EditBox($user->username, $plan, $user->edit_rows, $user->edit_cols, $edit_button);
    $editbox->action = 'edit.php';
    $editbox->method = 'post';
    return $editbox;
}
?>