view release on metacpan or search on metacpan
docsrc/reference.xml view on Meta::CPAN
Set this option to <emphasis>no</emphasis> to be compatible to PageKit < 1.09.
Defaults to <emphasis>yes</emphasis>.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.recent_login_timeout">
<term>recent_login_timeout</term>
<listitem>
<para>
Seconds that user's session has to be inactive before a user is asked
to verify a password on pages with the <literal><link linkend="config.page.require_login">require_login</link></literal> attribute
set to <emphasis>recent</emphasis>. Defaults to 3600 (1 hour).
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.relaxed_parser">
<term>relaxed_parser</term>
<listitem>
<para>
If set to yes, this option allows template tags to be placed inside
HTML comments. It also permits spaces and newlines within the tag itself.
docsrc/reference.xml view on Meta::CPAN
in the Model API.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.verify_page">
<term>verify_page</term>
<listitem>
<para>
Verify password form. Defaults to <literal><link linkend="config.global.login_page">login_page</link></literal>.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2>
<title>Section Attributes</title>
<para>
These options are global across each server and all Views. They are in the
docsrc/reference.xml view on Meta::CPAN
return $ses_key;
}
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Verifies the user-supplied credentials and return a session key. The
session key is a string that is stored on the user's computer using cookies.
Often you'll use the user ID and a MD5 hash of a a secret key, user ID, password.
</para>
<para>
Note that the string returned should not contain any commas, spaces, or semi-colons.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_auth_session_key">
<refnamediv>
<refname>pkit_auth_session_key</refname>
<refpurpose>Verifies a session key and returns the user ID and session ID
eg/Model/MyPageKit/Common.pm view on Meta::CPAN
is_error => 1);
return;
}
my $epasswd = crypt $passwd, "pk";
my $sql_str = "SELECT user_id, passwd FROM pkit_user WHERE login=?";
my ($user_id, $dbpasswd) = $dbh->selectrow_array($sql_str, {}, $login);
unless ($user_id && $dbpasswd && $epasswd eq crypt($dbpasswd,$epasswd)){
$model->pkit_gettext_message("Your login/password is invalid. Please try again.",
is_error => 1);
return;
}
no strict 'refs';
my $hash = Digest::MD5::md5_hex(join ':', ${ __PACKAGE__ . '::secret_md5' }, $user_id, $epasswd);
use strict 'refs';
my $ses_key = {
'user_id' => $user_id,
eg/Model/MyPageKit/MyModel.pm view on Meta::CPAN
params => [ qw( passwd1 passwd2 ) ]
},
passwd2 => { constraint => sub { return $_[0] eq $_[1]; },
params => [ qw( passwd1 passwd2 ) ]
},
},
messages => {
login => "The login, <b>%%VALUE%%</b>, has already been used.",
email => "The E-mail address, <b>%%VALUE%%</b>, is invalid.",
phone => "The phone number you entered is invalid.",
passwd1 => "The passwords you entered do not match.",
},
};
# validate user input
unless($model->pkit_validate_input($input_profile)){
$model->pkit_internal_redirect('newacct1');
return;
}
my $login = $model->input('login');
my $passwd = $model->input('passwd1');
eg/View/Default/login1.tmpl view on Meta::CPAN
<PKIT_COMPONENT NAME="/top">
<PKIT_COMPONENT NAME="/demo_desc">
Please login below:
<form method="get" action="login2">
Login:<br>
<input type="text" name="login">
<p>
Password:<br>
<input type="password" name="passwd">
<input type="hidden" name="pkit_login" value="1">
<input type="hidden" name="pkit_done" value="<PKIT_SELFURL>">
<p>
<input type="submit" name="submit" value="Login">
</form>
<PKIT_COMPONENT NAME="/bottom">
eg/View/Default/newacct1.tmpl view on Meta::CPAN
<PKIT_COMPONENT NAME="/demo_desc">
Please enter the information for your new account below:
<form method="post" action="newacct2">
<PKIT_ERRORSPAN NAME="email">Email:</PKIT_ERRORSPAN><br>
<input type="text" name="email">
<p>
<PKIT_ERRORSPAN NAME="login">Login:</PKIT_ERRORSPAN><br>
<input type="text" name="login">
<p>
<PKIT_ERRORSPAN NAME="passwd1">Password:</PKIT_ERRORSPAN><br>
<input type="password" name="passwd1">
<p>
<PKIT_ERRORSPAN NAME="passwd2">Password (verify):</PKIT_ERRORSPAN><br>
<input type="password" name="passwd2">
<input type="hidden" name="pkit_done" value="http://<PKIT_HOSTNAME>/">
<p>
<input type="submit" name="submit" value="Submit">
</form>
<PKIT_COMPONENT NAME="/bottom">
eg/contrib/locale/README view on Meta::CPAN
msgid "You did not fill out all the required fields. Please fill the <font
color=\"<PKIT_ERRORSTR>\">red</font> fields."
msgstr "Es wurden nicht alle erforderlichen Felder ausgefüllt. Bitte alle
<font color=\"<PKIT_ERRORSTR>\">roten</font> Felder ausfüllen."
#
# MyPageKit::Common
#
msgid "Your login/password is invalid. Please try again."
msgstr "Das Passwort oder der Login ist ungültig. Bitte nocheinmal versuchen"
msgid "You did not fill all of the fields. Please try again."
msgstr "Es wurden nicht all Felder ausgefüllt, bitte nocheinmal versuchen"
#
# MyPageKit::MyModel
#
msgid "Your changes have been made."
eg/contrib/locale/README view on Meta::CPAN
msgid "The login, <b>%%VALUE%%</b>, has already been used."
msgstr "Der Login <b>%%VALUE%%</b>, wird bereits verwendet."
msgid "The E-mail address, <b>%%VALUE%%</b>, is invalid."
msgstr "Die Emailadresse <b>%%VALUE%%</b> ist ungültig."
msgid "The phone number you entered is invalid."
msgstr "Die eingegebene Telefonnummer ist ungültig."
msgid "The passwords you entered do not match."
msgstr "Das eingegebene Passwort ist nicht richtig."
msgid "This message was passed throught pkit_redirect"
msgstr "Diese Nachricht wurde weitergeleitet durch pkit_redirect"
msgid "Another message passed throught pkit_redirect"
msgstr "Eine andere Nachricht weitergeleitet durch pkit_redirect"
msgid "This ERROR message was passed throught pkit_redirect"
msgstr "Diese Fehlermeldung wurde weitergeleitet durch pkit_redirect"
eg/contrib/locale/templates/empty/empty.po view on Meta::CPAN
msgid "Please try again."
msgstr ""
msgid "You did not fill out all the required fields. Please fill the <font color=\"<PKIT_ERRORSTR>\">red</font> fields."
msgstr ""
#
# MyPageKit::Common
#
msgid "Your login/password is invalid. Please try again."
msgstr ""
msgid "You did not fill all of the fields. Please try again."
msgstr ""
#
# MyPageKit::MyModel
#
msgid "Your changes have been made."
eg/contrib/locale/templates/empty/empty.po view on Meta::CPAN
msgid "[Session not set]"
msgstr ""
msgid "The login, <b>%%VALUE%%</b>, has already been used."
msgstr ""
msgid "The phone number you entered is invalid."
msgstr ""
msgid "The passwords you entered do not match."
msgstr ""
msgid "This message was passed throught pkit_redirect"
msgstr ""
msgid "Another message passed throught pkit_redirect"
msgstr ""
msgid "This ERROR message was passed throught pkit_redirect"
msgstr ""
eg/contrib/locale/templates/po/de.po view on Meta::CPAN
msgid "Please try again."
msgstr "Bitte nocheinmal versuchen."
msgid "You did not fill out all the required fields. Please fill the <font color=\"<PKIT_ERRORSTR>\">red</font> fields."
msgstr "Es wurden nicht alle erforderlichen Felder ausgefüllt. Bitte alle <font color=\"<PKIT_ERRORSTR>\">roten</font> Felder ausfüllen."
#
# MyPageKit::Common
#
msgid "Your login/password is invalid. Please try again."
msgstr "Das Passwort oder der Login ist ungültig. Bitte nocheinmal versuchen"
msgid "You did not fill all of the fields. Please try again."
msgstr "Es wurden nicht all Felder ausgefüllt, bitte nocheinmal versuchen"
#
# MyPageKit::MyModel
#
msgid "Your changes have been made."
eg/contrib/locale/templates/po/de.po view on Meta::CPAN
msgid "[Session not set]"
msgstr "[Session nicht gesetzt]"
msgid "The login, <b>%%VALUE%%</b>, has already been used."
msgstr "Der Login <b>%%VALUE%%</b>, wird bereits verwendet."
msgid "The phone number you entered is invalid."
msgstr "Die eingegebene Telefonnummer ist ungültig."
msgid "The passwords you entered do not match."
msgstr "Das eingegebene Passwort ist nicht richtig."
msgid "This message was passed throught pkit_redirect"
msgstr "Diese Nachricht wurde weitergeleitet durch pkit_redirect"
msgid "Another message passed throught pkit_redirect"
msgstr "Eine andere Nachricht weitergeleitet durch pkit_redirect"
msgid "This ERROR message was passed throught pkit_redirect"
msgstr "Diese Fehlermeldung wurde weitergeleitet durch pkit_redirect"
eg/contrib/locale/templates/po/fr.po view on Meta::CPAN
msgid "Please try again."
msgstr "Essayer encore, s'il vous plait"
msgid "You did not fill out all the required fields. Please fill the <font color=\"<PKIT_ERRORSTR>\">red</font> fields."
msgstr "Vous n'avez pas rempli tous les champs obligatoires. S'il vous plaît veuillez remplir tous les champs en <font color=\"<PKIT_ERRORSTR>\">rouge</font>"
#
# MyPageKit::Common
#
msgid "Your login/password is invalid. Please try again."
msgstr "Login et Mot de passe incorrect. S'il vous plait, réessayé"
msgid "You did not fill all of the fields. Please try again."
msgstr "Vous n'avez pas remplis tous les champs. S'il vous plait, réessayé"
#
# MyPageKit::MyModel
#
msgid "Your changes have been made."
eg/contrib/locale/templates/po/fr.po view on Meta::CPAN
msgid "[Session not set]"
msgstr "[Session inactive]"
msgid "The login, <b>%%VALUE%%</b>, has already been used."
msgstr "Ce login est déja utilisé"
msgid "The phone number you entered is invalid."
msgstr "Le numéro de téléphone saisi n'est pas valide"
msgid "The passwords you entered do not match."
msgstr "Mot de passe incorrect"
msgid "This message was passed throught pkit_redirect"
msgstr "Ce message est passé à travers pkit_redirect"
msgid "Another message passed throught pkit_redirect"
msgstr "Un autre message passé à travers pkit_redirect"
msgid "This ERROR message was passed throught pkit_redirect"
msgstr "Ce message d'erreur est passé à travers pkit_redirect"
eg/contrib/locale/templates/po/pt.po view on Meta::CPAN
msgid "Please try again."
msgstr "Por favor tente novamente"
msgid "You did not fill out all the required fields. Please fill the <font color=\"<PKIT_ERRORSTR>\">red</font> fields."
msgstr "Você não preencheu todos os campos. Favor preencher os campos em <font color =\"<PKIT_ERRORSTR>\">vermelho</font>"
#
# MyPageKit::Common
#
msgid "Your login/password is invalid. Please try again."
msgstr "Sua identificação/senha é inválida. Tente novamente"
msgid "You did not fill all of the fields. Please try again."
msgstr "Você não preencheu todos os campos. Tente novamente"
#
# MyPageKit::MyModel
#
msgid "Your changes have been made."
eg/contrib/locale/templates/po/pt.po view on Meta::CPAN
msgid "[Session not set]"
msgstr "[Sessão não definida]"
msgid "The login, <b>%%VALUE%%</b>, has already been used."
msgstr "O login <b>%%VALUE%%</b> já está registrado"
msgid "The phone number you entered is invalid."
msgstr "O número de telefone não é válido"
msgid "The passwords you entered do not match."
msgstr "As senhas digitadas não são iguais"
msgid "This message was passed throught pkit_redirect"
msgstr "Esta mensagem foi passada pelo pkit_redirect"
msgid "Another message passed throught pkit_redirect"
msgstr "Outra mensagem passada pelo pkit_redirect"
msgid "This ERROR message was passed throught pkit_redirect"
msgstr "A mensagem de ERRO foi passada pelo pkit_redirect"
lib/Apache/PageKit.pm view on Meta::CPAN
if(defined($pkit_check_cookie) && $pkit_check_cookie eq 'on'){
$model->pkit_gettext_message('You have successfully logged in.');
}
$pk->update_session($auth_session_id);
my $require_login = $config->get_page_attr($pk->{page_id},'require_login');
if(defined($require_login) && $require_login eq 'recent'){
if(exists($session->{pkit_inactivity_timeout})){
# user is logged in, but has had inactivity period
# display verify password form
$pk->{page_id} = $config->get_global_attr('verify_page') || $config->get_global_attr('login_page');
$pk->{browser_cache} = 'no';
# pkit_done parameter is used to return user to page that they originally requested
# after login is finished
$output_param_object->param("pkit_done",$uri_with_query) unless $apr->param("pkit_done");
# $apr->connection->user(undef);
}
}
t/06_login.t view on Meta::CPAN
my $r = POST '/login2',
[
login => '_illegal_login_',
passwd => 'wrong_secret',
pkit_done => '/index',
pkit_login => 1
];
ok t_cmp( 200, $r->code, '$r->code == 200 Found?' );
ok t_cmp( $r->content, qr:\QYour login/password is invalid. Please try again.:, "Invalid Login?");
$r = POST '/login2',
[
login => 'charlie_00000000',
passwd => 'wrong_secret',
pkit_done => '/index',
pkit_login => 1
];
ok t_cmp( 200, $r->code, '$r->code == 200 Found?' );
ok t_cmp( $r->content, qr:\QYour login/password is invalid. Please try again.:, "Login Invalid?");
$r = POST '/login2',
[
login => 'charlie_00000000',
passwd => 'MySecret',
pkit_done => '/index',
pkit_login => 1
];
ok t_cmp( 200, $r->code, '$r->code == 200 Found?' );
ok t_cmp( $r->content, qr:\QYou have successfully logged in.:, "Login success?");