Esempio n. 1
0
function Main()
{
    $usu = unserialize($_SESSION['usu']);
    $ins = new Instituicao();
    $tpl = file_get_contents("tpl/aluno/index.html");
    if ($_POST['txtSenha1'] && $_POST['txtSenha2']) {
        if ($_POST['txtSenha1'] == $_POST['txtSenha2']) {
            if (strlen($_POST['txtSenha1']) >= 6) {
                $usu->AlteraSenha(md5($_POST['txtSenha1']), "-999");
                header("Location:aluno.php?msg=" . base64_encode("@lng[Sua senha foi alterada com sucesso]"));
            } else {
                header("Location:aluno.php?a=as&msg=" . base64_encode("@lng[A senha deve ter no mínimo 6 caracteres]"));
            }
        } else {
            header("Location:aluno.php?a=as&msg=" . base64_encode("@lng[As senhas não são iguais]"));
        }
    }
    $ins->setCodigo($usu->getCodigoInstituicao());
    $ins->Carrega();
    if ($_GET['msg']) {
        $tplmsg = file_get_contents("tpl/aluno/mensagem.html");
        $tplmsg = str_replace('<!--mensagem-->', base64_decode($_GET['msg']), $tplmsg);
        $tpl = str_replace('<!--localmensagem-->', $tplmsg, $tpl);
    }
    $sNome = split(' ', $usu->getNome());
    $tpl = str_replace("<!--NomeAluno-->", $sNome[0], $tpl);
    $tpl = str_replace("<!--NomeInstituicao-->", '<a target="_blank" href="http://' . $ins->getSite() . '">' . $ins->getNomeCompleto() . '</a>', $tpl);
    if ($_GET['a']) {
        switch ($_GET['a']) {
            case 'as':
                AlteraSenha($tpl);
        }
    } else {
        Principal($tpl, $usu);
    }
}
Esempio n. 2
0
function Main()
{
    header('Content-Type: text/html; charset=iso-8859-1');
    if ($_POST['txtEmail'] && $_POST['txtNome'] && $_POST['txtResposta'] && $_SESSION['resp_perg']) {
        if ($_SESSION['resp_perg'] == $_POST['txtResposta']) {
            $senha = createRandomPassword();
            $intRet = AlteraSenha($senha);
            switch ($intRet) {
                case 1:
                    $tpl = file_get_contents("tpl/frm-recover-ok.html");
                    break;
                case -1:
                    $tpl = file_get_contents("tpl/frm-recover-dadosinc.html");
                    break;
                case -2:
                case -3:
                case -4:
                    $tpl = file_get_contents("tpl/frm-recover-erro.html");
                    break;
            }
        } else {
            $tpl = MontaJanela(true);
        }
    } else {
        $tpl = MontaJanela(false);
    }
    echo Comuns::Idioma($tpl);
}