Ejemplo n.º 1
0
function validation_conditions()
{
	$u=LPC_User::newUser();
	$conds=array();
	$conds[]=_LH('lpcAuthValidCondMinLength',$u->password_conditions['min_length']);
	if ($u->password_conditions['need_alpha'])
		$conds[]=_LH('lpcAuthValidCondAlpha');
	if ($u->password_conditions['need_numeric'])
		$conds[]=_LH('lpcAuthValidCondNumeric');
	return "<ul><li>".implode($conds,"</li><li>")."</li></ul>";
}
Ejemplo n.º 2
0
<?php

$p=LPC_Page::getCurrent();
$p->title=_LS('lpcAuthRecoverTitle');
$p->st();

if (LPC_User::getCurrent(true)) {
	$p->a(new LPC_HTML_error(_LH('lpcAuthErrAlreadyLoggedOn')));
	return;
}

if (!empty($_POST['email'])) {
	// Requesting e-mail
	$us=LPC_User::newUser();
	$us=$us->search($us->user_fields["email"],$_POST['email']);
	if ($us && !$us[0]->sendRecover())
		$p->a(new LPC_HTML_error(_LH('lpcAuthErrFailEmail',$_POST['email'])));
	else
		$p->a(new LPC_HTML_confirm(_LH('lpcAuthConfirmRecoverEmail',$_POST['email'])));
	return;
}

$form=new LPC_HTML_form();
$p->a($form);
$div=new LPC_HTML_node('div');
$form->a($div);
$div->a("
<table>
<tr>
	<td>"._LS('lpcAuthRecoverEmailField')."</td>
	<td><input type='text' name='email' id='email'></td>
Ejemplo n.º 3
0
require LPC_include."/adodb5/adodb.inc.php";
require LPC_include."/LPC_include_manager.php";
require LPC_include."/LPC_intl.php";
require LPC_include."/LPC_config.php";

if (LPC_GUI)
	require LPC_include."/LPC_icons.php";

if (LPC_GUI_OB)
	ob_start();

if (
	getenv("LPC_auth") &&
	isset($_SERVER['REMOTE_ADDR']) && // not for CLI
	!LPC_User::getCurrent(true) &&
	($usr=LPC_User::newUser()) && // lazy instantiation
	LPC_URI::getCurrent()->getPath() != $usr->recoverPasswordURL() &&
	LPC_URI::getCurrent()->getFullPath() != $usr->processTokenBaseURL()
)
	LPC_User::getCurrent();

function LPC_prefill(&$array, $values)
{
	$count=0;
	foreach($values as $key=>$value) {
		if (array_key_exists($key, $array))
			continue;
		$array[$key]=$value;
		$count++;
	}
	return $count;
Ejemplo n.º 4
0
Archivo: debug.php Proyecto: Gutza/LPC
<?php

$p=LPC_Page::getCurrent();
$p->st(_LS('rightsTestCache'));

if (!LPC_User::getCurrent()->isSuperuser()) {
	$p->a(new LPC_HTML_error(_LS('genericErrorRights')));
	return;
}

$u=LPC_User::newUser();
$u->idFromArrayKey($_REQUEST, 'user_id');

$f=new LPC_HTML_form();
$p->a($f);
$f->a(htmlspecialchars(_LS('rightsTestUserID')).": <input type='text' name='user_id' value='".$u->id."'> ");
$f->a("<input type='submit' name='submit' value='"._LS('rightsTestSubmit')."'>");

if (!$u->id)
	return;

if (defined('LPC_project_class') && LPC_project_class)
	$prj=LPC_Project::getCurrent();
else
	$prj=NULL;

$cache=LPC_Cache::getCurrent();
$t=new LPC_HTML_table();
$p->a($t);
$t->a("<tr><th>"._LS('rightTestUserDate')."</td><td>".date('r', $cache->getUPf(LPC_User::PD_KEY, $u->id))." (".($u->validatePermissionsCache()?"VALID":"INVALID").")</td></tr>");
$t->a("<tr><th>"._LS('rightTestGlobalExpDate')."</th><td>".date('r', $cache->getG(LPC_User::PE_KEY))."</td></tr>");