Initial version, with no update possibility

This commit is contained in:
Gergely Polonkai (W00d5t0ck)
2010-12-17 15:41:45 +01:00
commit 7c6ed627cc
27 changed files with 1318 additions and 0 deletions

36
cpw.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
require 'config.php';
include 'sanitychecks.php';
include 'session.php';
include 'check_user.php';
include 'smarty_init.php';
include 'class.db.php';
$error = 0;
if (array_key_exists('oldpw', $_POST) && array_key_exists('newpw1', $_POST) && array_key_exists('newpw2', $_POST))
{
$error = '';
try {
pwsdbh($dbDSN)->changePassword($_SESSION['loginuser'], $_POST['oldpw'], $_POST['newpw1'], $_POST['newpw2']);
$error = 0;
}
catch (PDOException $e)
{
$error = 255;
}
catch (PWSdbhException $e)
{
$error = $e->getCode();
}
catch (Exception $e)
{
$error = 254;
}
}
$tpl->assign('errno', $error);
$tpl->assign('isadmin', pwsdbh($dbDSN)->isAdmin($_SESSION['loginuser']));
$tpl->display('cpw.tpl');