Example #1
0
     if ($_CONF['allow_account_delete'] == 1 && $_USER['uid'] > 1) {
         $accountId = COM_applyFilter($_POST['account_id']);
         if (!empty($accountId)) {
             $display .= confirmAccountDelete($accountId);
         } else {
             $display = COM_refresh($_CONF['site_url'] . '/index.php');
         }
     } else {
         $display = COM_refresh($_CONF['site_url'] . '/index.php');
     }
     break;
 case 'deleteconfirmed':
     if ($_CONF['allow_account_delete'] == 1 && $_USER['uid'] > 1) {
         $accountId = COM_applyFilter($_POST['account_id']);
         if (!empty($accountId)) {
             $display .= deleteUserAccount($accountId);
         } else {
             $display = COM_refresh($_CONF['site_url'] . '/index.php');
         }
     } else {
         $display = COM_refresh($_CONF['site_url'] . '/index.php');
     }
     break;
 case 'plugin':
     PLG_profileExtrasSave($_POST['plugin']);
     $display = COM_refresh($_CONF['site_url'] . '/usersettings.php?msg=5');
     break;
 default:
     // also if $mode == 'edit', 'preferences', or 'comments'
     $display .= COM_siteHeader('menu', $LANG04[16]);
     $display .= COM_showMessageFromParameter();
Example #2
0
        echo "<p class=\"error\">" . T_("This is the demo account") . ".</p>";
    } else {
        if ($_POST['submitted']) {
            $uname = $_POST['uname'];
            $actpass = $_POST['pass'];
            include 'conn.php';
            if ($user->isAdmin()) {
                deleteUserAccount($uname);
                $success = true;
            } else {
                if ($actpass != null) {
                    $passencrypt = $user->encryptPassword($actpass);
                    $Query = "select name from " . TABLE_PREFIX . "session where name='" . $uname . "' and pass='******'";
                    $dbResult = $dblink->query($Query);
                    if ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) {
                        deleteUserAccount($uname);
                        $success = true;
                    } else {
                        echo "<p class=\"error\">" . T_("The password is incorrect") . "</p>";
                    }
                } else {
                    echo "<p class=\"error\">" . T_("Please enter your password in order to delete your account") . ".</p>";
                }
            }
        }
        if (!$success) {
            ?>

<form action="deleteaccount.php" method="post">
<input type="hidden" name="uname" value="<?php 
            $user = new User();
Example #3
0
function getProfileViewRegistrantsForm()
{
    if (isset($_GET['subsubaction'])) {
        if ($_GET['subsubaction'] == 'editregistrant' && (isset($_GET['useremail']) || isset($_POST['useremail']))) {
            $email = isset($_GET['useremail']) ? escape($_GET['useremail']) : escape($_POST['useremail']);
            return profile(getUserIdFromEmail($email), true);
        } elseif ($_GET['subsubaction'] == 'deleteregistrant' && isset($_GET['useremail'])) {
            deleteUserAccount(getUserIdFromEmail(escape($_GET['useremail'])));
        }
    }
    return getProfileRegistrantsList($_GET['subaction'] == 'editsiteregistrants');
}
You should have received a copy of the GNU General Public License
along with GetBoo; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
***************************************************************************/
set_time_limit(0);
include 'header.php';
echo "<h2>" . T_("Settings") . " -- " . T_("Inactive Users") . "</h2>\n";
$dateDiff = isset($_POST["dateDiff"]) && $_POST["dateDiff"] != "" ? $_POST["dateDiff"] : 7;
echo "<div class=\"content\"><p>" . sprintf(T_("Removing inactive users (users who signed up more than %s days ago without activating their account)"), $dateDiff) . "...<br>";
include 'conn.php';
require_once 'includes/tags_functions.php';
$Query = "select session.name, session.datejoin AS formatted_time from " . TABLE_PREFIX . "session, " . TABLE_PREFIX . "activation where (session.name = activation.name and session.status='disabled' and " . DATE_DIFF_SQL . " datejoin)/" . DAY_SECONDS . " >= {$dateDiff} and activation.activated='N')";
//var_dump($Query)
$dbResult = $dblink->query($Query);
$count = 0;
$users = array();
while ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) {
    $users[$count++] = $row;
}
include "includes/f_deleteaccount.php";
foreach ($users as $current_user) {
    $uname = "{$current_user["name"]}";
    deleteUserAccount($uname, true);
}
if ($count > 0) {
    echo "<br><br><b>" . $count . "</b> " . T_("users have been deleted") . "!<br><a href=\"controlpanel.php\"><< Go back to Control Panel</a></p>";
} else {
    echo "<br>" . T_("No") . " " . T_("users have been deleted") . ".";
}
echo "<p><a href=\"manageusers.php\"><< " . T_("Back") . "</a></p>";