view release on metacpan or search on metacpan
Require valid-user
</Location>
As always, you must restart your application for changes to take effect.
ADMIN ACCESS
The login information below is currently set-up by default. In order to
manage user access this account must exist within your "htpasswd"
User Name admin
Password password
OPTIONAL
If database support is available, you can log control panel user actions
to a database. The database table to store logging information is
auto-generated. Since this is the case, the SQL user must have CREATE
privileges.
In case you want to manually create this table, you can run the
following SQL statement on the database command-line:
PRIMARY KEY (admin_log_id)
);
If a database is not available at the time data is collected, this
information will be written to a file that can be located in your
project "logs" directory.
DEBUG MODE
If debugging is enabled, the URI and query string are logged. This can
pose as a security risk when running in a production environment since
personal information (including passwords) may be exposed.
SEE ALSO
Apache2::WebApp, Apache2::WebApp::Plugin::DBI,
Apache2::WebApp::Plugin::DateTime, Apache::Htpasswd
AUTHOR
Marc S. Brooks, <mbrooks@cpan.org> <http://mbrooks.info>
COPYRIGHT
This program is free software; you can redistribute it and/or modify it
lib/Apache2/WebApp/Extra/Admin.pm view on Meta::CPAN
</Location>
As always, you must restart your application for changes to take effect.
=head1 ADMIN ACCESS
The login information below is currently set-up by default. In order to
manage user access this account must exist within your C<htpasswd>
User Name admin
Password password
=head1 OPTIONAL
If database support is available, you can log control panel user actions
to a database. The database table to store logging information is
auto-generated. Since this is the case, the SQL user must have CREATE
privileges.
In case you want to manually create this table, you can run the following
SQL statement on the database command-line:
lib/Apache2/WebApp/Extra/Admin.pm view on Meta::CPAN
);
If a database is not available at the time data is collected, this
information will be written to a file that can be located in your project
C<logs> directory.
=head1 DEBUG MODE
If debugging is enabled, the URI and query string are logged. This can
pose as a security risk when running in a production environment since
personal information (including passwords) may be exposed.
=head1 SEE ALSO
L<Apache2::WebApp>, L<Apache2::WebApp::Plugin::DBI>,
L<Apache2::WebApp::Plugin::DateTime>, L<Apache::Htpasswd>
=head1 AUTHOR
Marc S. Brooks, E<lt>mbrooks@cpan.orgE<gt> L<http://mbrooks.info>
usr/share/webapp-toolkit/extra/class/admin.tt view on Meta::CPAN
);
If a database is not available at the time data is collected, this
information will be written to a file that can be located in your project
C<logs> directory.
=head1 DEBUG MODE
If debugging is enabled, the URI and query string are logged. This can
pose as a security risk when running in a production environment since
personal information (including passwords) may be exposed.
=head1 SEE ALSO
L<Apache2::WebApp>, L<Apache2::WebApp::Plugin::DBI>
=head1 AUTHOR
Marc S. Brooks, E<lt>mbrooks@cpan.orgE<gt> L<http://mbrooks.info>
=head1 COPYRIGHT
usr/share/webapp-toolkit/extra/class/admin_users_add.tt view on Meta::CPAN
else {
if ($pwd->fetchPass( $param{username} ) ) {
$error{username} = ERROR_USERNAME_EXISTS;
}
}
}
else {
$error{username} = ERROR_REQUIRED;
}
# check the password field data
if ($param{password}) {
unless ($param{password} =~ /\A (?: .){8,15} \z/x)
{
$error{password} = ERROR_PASSWORD;
}
}
else {
$error{password} = ERROR_REQUIRED;
}
unless (values %error) {
my $username = $param{username};
$param{username} =~ s/(\w+)/\#$1/gi;
$pwd->htpasswd($param{username}, $param{password});
$pwd->writeInfo($param{username}, time() );
$self->SUPER::_log_action($c, "Added User ($username)");
# list the users
$self->_list_users($c);
}
else {
usr/share/webapp-toolkit/extra/class/admin_users_edit.tt view on Meta::CPAN
!$pwd->fetchPass('#' . $param{username} ) )
{
$error{username} = ERROR_USERNAME_DOESNT_EXIST;
}
}
}
else {
$error{username} = ERROR_REQUIRED;
}
# check the password field data
if ($param{password}) {
unless ($param{password} =~ /\A (?: .){8,15} \z/x)
{
$error{password} = ERROR_PASSWORD;
}
}
else {
$error{password} = ERROR_REQUIRED;
}
unless (values %error) {
$pwd->htpasswd($param{username}, $param{password}, { overwrite => 1 });
$self->SUPER::_log_action($c, 'Updated User (' . $param{username} . ')');
# list the users
$self->_list_users($c);
}
else {
$error{alert} = ERROR_FORM_INPUT;
usr/share/webapp-toolkit/extra/htdocs/admin/js/form.js view on Meta::CPAN
function disableSubmit() {
document.getElementById("allow").disabled = true;
document.forms[form].submit(); // i.e. is lame, fix
}
function focusFirstField(name) {
if (!name) { name = 0 }
for(var i = 0; i < document.forms[name].length; i++) {
if (document.forms[name][i].type == "text" ||
document.forms[name][i].type == "password") {
if (document.forms[name][i].disabled != true) {
document.forms[name][i].focus();
break;
}
}
}
}
usr/share/webapp-toolkit/extra/templates/admin/users_form.tt view on Meta::CPAN
<script type="text/javascript" src="/extras/admin/js/disable.js"></script>
<script type="text/javascript" src="/extras/admin/js/form.js"></script>
<style type="text/css">
@import url( /extras/admin/css/base.css );
@import url( /extras/admin/css/content.css );
@import url( /extras/admin/css/form.css );
</style>
</head>
<body onLoad="requireFields([% UNLESS param.username && !error.username %]'username',[% END %]'password'); focusFirstField()">
<noscript>
<h2>
To use this admin you must have a JavaScript-enabled browser
</h2>
</noscript>
<!-- page begin -->
usr/share/webapp-toolkit/extra/templates/admin/users_form.tt view on Meta::CPAN
</div>
[% END %]
<label>
<strong>
• [% IF edit %]New [% END %]Password
</strong>
</label>
<div>
<input class="field0 [% IF error.password %]error[% END %]" type="text" name="password" value="[% param.password %]" maxlength="15" [% IF error.password %]title="[% error.password %]"[% END %] />
</div>
<p class="notes">
Your password must be a minimum of 8 characters and is case-sensitive
</p>
</fieldset>
<div>
<input id="allow" class="button0" type="submit" value="[% IF edit %]Save Changes[% ELSE %]Submit[% END %]" />
</div>
</div>
</form>