Example #1
0
</strong>?<br />
<form method="POST" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
">
	<input type="hidden" name="uid" value="<?php 
    echo (int) $_POST['uid'];
    ?>
" />
	<input type="submit" name="submitfull" value="Yes, Kabosh" />
	<input type="submit" name="cancel" value="No, I f****d up :(" />
</form>
<?php 
} else {
    if (isset($_POST['submitfull']) && isset($_POST['uid'])) {
        $upm = UserProfileModel::getInstance();
        $user = $upm->getByUserID($_POST['uid']);
        if (!$user) {
            die('You screwed up. There\'s no user with that ID.</body></html>');
        }
        $banid = (int) $_POST['uid'];
        echo "Deleting the links...<br />\n";
        $query = new Query('UPDATE');
        $query->table('links');
        $query->set('active = ?', 0);
        $query->where('submitter_id = ?', $banid);
        $stmt = $query->prepare();
        $stmt->execute();
        echo "All of user {$user->username}'s links have been deleted.<br />\n";
        echo "Banning the dickhead...<br />\n";
        $ipstoban = array();
Example #2
0
 public static function register($username, $password, $email, $requireValidation, &$validationCode)
 {
     $upm = UserProfileModel::getInstance();
     $salt = $upm->generateSalt();
     $group = $requireValidation ? 3 : 4;
     $result = $upm->create($username, $password, $email, $salt, $group, 1, false, $requireValidation);
     if ($result != UserProfileModel::CREATE_OK || !$requireValidation) {
         return $result;
     }
     $validationCode = md5($username . $email . $salt);
     return $result;
 }