Exemple #1
0
function Avatars()
{
    global $CFG, $aAvatars;
    // What are they wanting to do?
    switch ($_REQUEST['action']) {
        case 'add':
            AddAvatar();
        case 'remove':
            RemoveAvatar();
        case 'edit':
            EditAvatar();
    }
    // Are they coming for the first time or submitting information?
    if (isset($_REQUEST['submit'])) {
        // Submitting information, so store it.
        $aOptions['maxdims'] = abs((int) $_REQUEST['maxdims']);
        $aOptions['maxsize'] = abs((int) $_REQUEST['maxsize']);
        // Validate the information, and submit it to the database if everything's okay.
        UpdateAvatars($aOptions);
    } else {
        // Coming for the first time, so set the defaults.
        $aOptions['maxdims'] = $CFG['avatars']['maxdims'];
        $aOptions['maxsize'] = $CFG['avatars']['maxsize'];
    }
    // Template
    require "./skins/{$CFG['skin']}/admincp/avatars.tpl.php";
    // Send the page.
    exit;
}
         unset($x, $nicks);
     }
     #Antispam code if no other errors
     if ($noSPAM && !$error) {
         if ($noSPAM->verify(array('about', 'login', 'mail', 'www'))) {
             $noSPAM = false;
         } else {
             $error[] = $lang[$noSPAM->errorId];
         }
     }
 } elseif (isset($cfg['upload']) && $_FILES['photo']['name']) {
     require './lib/avatar.php';
     $photo = Avatar($error);
 } elseif (isset($_POST['del'])) {
     require './lib/avatar.php';
     $photo = RemoveAvatar($error);
 }
 #Change E-mail or password
 if (UID && $_POST['pass']) {
     if (md5($_POST['curPass']) === $user['pass']) {
         if (isset($_COOKIE[PRE . 'login'])) {
             $auto = 1;
         }
     } else {
         $error[] = $lang['mustPass'];
     }
 }
 #Password
 if (UID && empty($_POST['pass'])) {
     $u['pass'] = $user['pass'];
 } else {