예제 #1
0
    if ($ocarina->config[0]->registrazioni == 0) {
        $ocarina->addValue('result', $ocarina->getLanguage('registration', 5));
    } elseif ($nickname !== '' && $password !== '' && $confPassword !== '' && $email !== '') {
        $captcha->checkCaptcha();
        if ($captcha->getError() !== false) {
            $ocarina->addValue('result', $ocarina->getLanguage('registration', 12));
        } elseif ($password == $confPassword && strlen($password) > 4 && strlen($nickname) > 4) {
            if ($ocarina->config[0]->validazioneaccount == 1) {
                $codice = $ocarina->getCode();
                // Validazione account
                $array = array($nickname, $password, $email, 6, date('d-m-y'), date('G:m:s'), $codice, $ocarina->config[0]->skin);
                if ($ocarina->createUser($array)) {
                    $ocarina->sendMail($email, $ocarina->config[0]->nomesito . ' @ Validazione account per ' . $nickname . '.', 'Ciao ' . $nickname . ',
					dal momento che ti sei registrato, il sistema ha bisogno di essere sicuro che la tua email sia valida.
					Per validarla ti basta cliccare il seguente link: ' . $ocarina->config[0]->url_index . '/registrazione.php?codice=' . $codice . '

					Se non sei tu ' . $nickname . ', ignora questa email.

					Il webmaster di ' . $ocarina->config[0]->nomesito . '.');
                    $ocarina->addValue('result', $ocarina->getLanguage('registration', 6) . header('Refresh: 2; URL=' . $ocarina->config[0]->url_index . '/login.php'));
                    if ($ocarina->config[0]->log == 1) {
                        $ocarina->log($nickname, 'Registrated.');
                    }
                } else {
                    $ocarina->addValue('result', $ocarina->getLanguage('registration', 7));
                    if ($ocarina->config[0]->log == 1) {
                        $ocarina->log($nickname, 'Registration failed.');
                    }
                }
            } else {
                $array = array($nickname, $password, $email, 6, date('d-m-y'), date('G:m:s'), '', $ocarina->config[0]->skin);
예제 #2
0
*/
require_once '../core/class.Ocarina.php';
$ocarina = new Ocarina();
$testo_email = isset($_POST['testo']) && $_POST['testo'] !== '' ? $_POST['testo'] : '';
$oggetto_email = isset($_POST['oggetto']) && $_POST['oggetto'] !== '' ? $_POST['oggetto'] : '';
$submit = isset($_POST['submit']) ? true : false;
$ocarina->skin = 'admin';
$ocarina->addValue('titolo', $ocarina->getLanguage('title', 30) . $ocarina->getLanguage('title', 2) . $ocarina->getLanguage('title', 10) . $ocarina->getLanguage('title', 2) . $ocarina->config[0]->nomesito);
if ($ocarina->isLogged() && $ocarina->username[0]->grado == 1) {
    if ($submit) {
        if ($testo_email !== '' && $oggetto_email !== '') {
            $ocarinas = $ocarina->getUser();
            $notsended = 0;
            $sended = 0;
            foreach ($ocarinas as $v) {
                if (!$ocarina->sendMail($v->email, $oggetto_email, $testo_email)) {
                    ++$notsended;
                } else {
                    ++$sended;
                }
            }
            if ($notsended == 0) {
                $ocarina->addValue('result', str_replace('{$sended}', $sended, $ocarina->getLanguage('newsletter', 0)));
            } else {
                $ocarina->addValue('result', str_replace('{$notsended}', $notsended, str_replace('{$sended}', $sended, $ocarina->getLanguage('newsletter', 1))));
            }
        } else {
            $ocarina->addValue('result', $ocarina->getLanguage('newsletter', 2));
        }
    } else {
        $ocarina->addValue('result', $ocarina->getLanguage('error', 4));
        }
    } elseif ($email !== '' && !$recupero) {
        $captcha->checkCaptcha();
        if ($captcha->getError() !== false) {
            $ocarina->addValue('result', $ocarina->getLanguage('recoverpassword', 9));
        } else {
            if (($ocarinaname = $ocarina->searchUserByField('email', $email)) !== false) {
                if ($ocarinaname[0]->email == $email) {
                    $nickname = $ocarinaname[0]->nickname;
                    $codice = $ocarina->getCode();
                    if ($ocarina->editUser('codicerecupero', $codice, $nickname)) {
                        if ($codice !== '') {
                            $ocarina->sendMail($email, $ocarina->config[0]->nomesito . ' @ Recupero password per ' . $nickname . '.', 'Ciao ' . $nickname . ',
	dal momento che hai perso la tua password attuale, il sistema ne ha generata una casualmente.
	Per attivarla, ti basta cliccare il seguente link: ' . $ocarina->config[0]->url_index . '/recuperapassword.php?codice=' . $codice . '

	Se non sei tu ' . $nickname . ' oppure semplicemente non hai richiesto una nuova password, ignora questa email.

	Il webmaster di ' . $ocarina->config[0]->nomesito . '.');
                            $ocarina->addValue('result', $ocarina->getLanguage('recoverpassword', 4));
                            if ($ocarina->config[0]->log == 1) {
                                $ocarina->log($nickname, 'Recover mail sent.');
                            }
                        } else {
                            $ocarina->addValue('result', $ocarina->getLanguage('recoverpassword', 5));
                            if ($ocarina->config[0]->log == 1) {
                                $ocarina->log('~', 'Password recovery failed.');
                            }
                        }
                    } else {
                        $ocarina->addValue('result', $ocarina->getLanguage('recoverpassword', 5));