Exemple #1
0
if (isset($_POST['save'])) {
    //Include old password.
    require_once 'data/settings/pass.php';
    //SHA512-encrypt posted passwords.
    if (!empty($cont1)) {
        $cont1 = hash('sha512', $cont1);
    }
    //Check if the old password entered is correct. If it isn't, do:
    if ($ww != $cont1) {
        $error = show_error($lang['changepass']['cant_change'], 1, true);
    } elseif (empty($cont2)) {
        $error = show_error($lang['changepass']['empty'], 1, true);
    } elseif ($cont2 != $cont3) {
        $error = show_error($lang['changepass']['different'], 1, true);
    } else {
        save_password($cont2);
        show_error($lang['changepass']['changed'], 3);
        redirect('?action=options', 2);
        include_once 'data/inc/footer.php';
        exit;
    }
}
?>
<p>
	<strong><?php 
echo $lang['changepass']['message'];
?>
</strong>
</p>
<?php 
if (isset($error)) {
Exemple #2
0
if (isset($_GET['step']) && $_GET['step'] == '1') {
    ?>
	<p>To start the upgrade procedure, please enter the password of your pluck installation below.</p>

	<form action="" method="post">
		<input name="cont1" size="25" type="password" />
		<input type="submit" name="submit" value="Proceed" />
	</form>

<?php 
    if (isset($_POST['submit'])) {
        //Include old MD5-hashed password
        require_once 'data/settings/pass.php';
        //If entered password is valid, safe it in new SHA512 hash
        if ($ww == md5($cont1)) {
            save_password($cont1);
            redirect('?step=2', 0);
        } else {
            show_error('The password you entered is invalid.', 1);
        }
    }
}
//----------------
//Step 2
//Convert pages, blog (posts, comments & categories) and albums
//----------------
if (isset($_GET['step']) && $_GET['step'] == '2') {
    ?>

	<p>The updater is now converting all the files to the new formats...</p>
Exemple #3
0
     if (!preg_match('/^.+@.+\\..{2,4}$/', $cont2)) {
         $error['email'] = show_error($lang['settings']['email_invalid'], 1, true);
     }
     //Check the passwords.
     if (empty($cont4)) {
         $error['pass'] = show_error($lang['changepass']['empty'], 1, true);
     } elseif ($cont4 != $cont5) {
         $error['pass'] = show_error($lang['changepass']['different'], 1, true);
     }
     if (!isset($error)) {
         //Save prefered language.
         save_language($cont3);
         //Save options.
         save_options($cont1, $cont2, 'yes');
         //Save password.
         save_password($cont4);
         //Save theme.
         save_theme('default');
         //Make some dirs for the trashcan, modules and pages.
         foreach (array('data/trash/pages', 'data/trash/images', 'data/trash/files', 'data/settings/modules', PAGE_DIR) as $dir) {
             if (!is_dir($dir)) {
                 mkdir($dir);
             }
             chmod($dir, 0777);
         }
         unset($dir);
         redirect('?action=step3', 0);
         include_once 'data/inc/footer.php';
         exit;
     }
 }
xassert_eqq($te2_cdb->affiliation, "String");
// borrow from cdb
$acct = $us->save((object) ["email" => "te@_.com"]);
xassert(!!$acct);
$te = user("te@_.com");
xassert_eqq($te->email, "te@_.com");
xassert_eqq($te->firstName, "Te");
xassert_eqq($te->lastName, "Thamrongrattanarit");
xassert_eqq($te->affiliation, "Brandeis University");
xassert_eqq($te->collaborators, "Computational Linguistics Magazine");
// create a user in cdb: create, then delete from local db
$anna = "*****@*****.**";
xassert(!user($anna));
$acct = $us->save((object) ["email" => $anna, "first" => "Anna", "last" => "Akhmatova"]);
xassert(!!$acct);
Dbl::qe("delete from ContactInfo where email=?", $anna);
save_password($anna, "aquablouse", true);
xassert(!user($anna));
$user_estrin = user("*****@*****.**");
$user_floyd = user("*****@*****.**");
$user_van = user("*****@*****.**");
$ps = new PaperStatus(null);
$ps->save_paper_json((object) ["id" => 1, "authors" => ["*****@*****.**", $user_estrin->email, $user_floyd->email, $user_van->email, $anna]]);
$paper1 = $Conf->paperRow(1, $user_chair);
$user_anna = user($anna);
xassert(!!$user_anna);
xassert($user_anna->act_author_view($paper1));
xassert($user_estrin->act_author_view($paper1));
xassert($user_floyd->act_author_view($paper1));
xassert($user_van->act_author_view($paper1));
xassert_exit();