Page MenuHomeGitPull.it

No OneTemporary

Authored By
Unknown
Size
9 KB
Referenced Files
None
Subscribers
None
diff --git a/template/mail-user-password.php b/template/mail-user-password.php
index 5e18ba7..efe88bf 100644
--- a/template/mail-user-password.php
+++ b/template/mail-user-password.php
@@ -1,54 +1,54 @@
<?php
# Copyright (C) 2018 Valerio Bozzolan
# Boz Libre Hosting Panel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
/*
* This is the template for the e-mail that contains the user password
*
* Called from
* template/sidebar.php
*/
// unuseful when load directly
defined( 'BOZ_PHP' ) or die;
?>
<?php printf(
__( "Hello %s %s!" ),
$name,
$surname
) ?>
<?php printf(
__( "Here you are your credentials for your account into the %s:" ),
SITE_NAME
) ?>
<?= $uid ?>
<?= $password ?>
<?= __( "I remember you that the login page is there:" ) ?>
<?= http_build_get_query(
- menu_entry( 'login' )->getSitePage( true ), [
+ menu_entry( 'login' )->getAbsoluteURL(), [
'user_uid' => $uid
]
) ?>
diff --git a/www/index.php b/www/index.php
index 1b052bb..42d8e3c 100644
--- a/www/index.php
+++ b/www/index.php
@@ -1,80 +1,80 @@
<?php
# Copyright (C) 2018 Valerio Bozzolan
# Boz Libre Hosting Panel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
/*
* This is the homepage of your hosting panel
*/
// load framework
require '../load.php';
// require read permissions
require_permission( 'read' );
// spawn header
Header::spawn( [
'breadcrumb' => false,
] );
// user domains
$domains = ( new DomainAPI() )
->select( [
'domain.domain_ID',
'domain_name',
'domain_active',
] )
->whereDomainIsEditable()
->orderBy( 'domain_name' )
->queryGenerator();
?>
<p class="lead"><?php printf(
__( "Welcome in your %s dashboard!" ),
SITE_NAME
) ?></p>
<?php if( $domains->valid() ): ?>
<h3><?php printf(
__( "Your %s" ),
__( "domains" )
) ?></h3>
<ul>
<?php foreach( $domains as $domain ): ?>
<li>
<code>
<?php if( $domain->domain_active ): ?>
- <?php echo HTML::a(
+ <?= HTML::a(
$domain->getDomainPermalink(),
$domain->domain_name
) ?>
<?php else: ?>
- <del><?php _esc_html( $domain->domain_name ) ?></del>
+ <del><?= esc_html( $domain->domain_name ) ?></del>
<?php endif ?>
</code>
</li>
<?php endforeach ?>
</ul>
<?php if( has_permission( 'edit-domain-all' ) ): ?>
- <p><a class="btn btn-default" href="<?php echo ROOT ?>/domain.php"><?php _e( "Add" ) ?></a></p>
+ <p><a class="btn btn-default" href="<?= ROOT ?>/domain.php"><?php echo __( "Add" ) ?></a></p>
<?php endif ?>
<?php endif ?>
<?php
// spawn footer
Footer::spawn();
diff --git a/www/login.php b/www/login.php
index 710d371..41b236b 100644
--- a/www/login.php
+++ b/www/login.php
@@ -1,79 +1,76 @@
<?php
# Copyright (C) 2018 Valerio Bozzolan
# Boz Libre Hosting Panel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
/*
* This is the login page
*/
// load framework
require '../load.php';
// spawn header
Header::spawn();
// go to the wanted page (or homepage)
if( login() ) {
http_redirect( after_login_url(), 307 );
}
?>
<?php if( isset( $_POST[ 'user_uid' ] ) ): ?>
- <p class="alert alert-warning"><?php _e( "Authentication failed!" ) ?></p>
+ <p class="alert alert-warning"><?= __( "Authentication failed!" ) ?></p>
<?php endif ?>
<p><?php printf(
__( "You need %s credentials to proceed." ),
SITE_NAME
) ?></p>
<form method="post">
<div class="form-group">
- <label for="user-uid"><?php _e( "Username" ) ?></label>
- <input type="text" class="form-control" name="user_uid" id="user-uid" placeholder="<?php _e( "foo.bar" ) ?>"<?php _value( @ $_REQUEST[ 'user_uid' ] ) ?> />
+ <label for="user-uid"><?= __( "Username" ) ?></label>
+ <input type="text" class="form-control" name="user_uid" id="user-uid" placeholder="<?= __( "foo.bar" ) ?>"<?php echo value( @ $_REQUEST[ 'user_uid' ] ) ?> />
</div>
<div class="form-group">
- <label for="user-password"><?php _e( "Password" ) ?></label>
+ <label for="user-password"><?= __( "Password" ) ?></label>
<input type="password" class="form-control" name="user_password" id="user-password" />
</div>
<?php if( ! empty( $_POST[ 'user_uid' ] ) ): ?>
- <p><a href="<?php
- // the password reset URL
- echo http_build_get_query(
- get_menu_entry( 'password-reset' )->getSitePage( ROOT ), [
- 'user_uid' => @ $_REQUEST[ 'user_uid' ],
- ] );
- ?>"><?php _e( "Lost password?" ) ?></a></p>
+ <p><a href="<?= http_build_get_query(
+ menu_entry( 'password-reset' )->getURL(), [
+ 'user_uid' => @ $_REQUEST[ 'user_uid' ],
+ ] ) ?>"><?= __( "Lost password?" ) ?></a></p>
<?php endif ?>
- <button type="submit" class="btn btn-default"><?php _e( "Login" ) ?></button>
+ <button type="submit" class="btn btn-default"><?= __( "Login" ) ?></button>
</form>
<?php
// spawn footer
Footer::spawn();
/**
* Return the back URL to be redirected after the login action
*/
function after_login_URL() {
if( isset( $_GET[ 'redirect' ] ) && 0 === strpos( $_GET[ 'redirect' ], '/' ) ) {
return site_page( $_GET[ 'redirect' ], URL );
}
- return get_menu_entry( 'index' )
+ return menu_entry( 'index' )
->getSitePage( URL );
}
diff --git a/www/password-reset.php b/www/password-reset.php
index 82c59e2..c0c4f64 100644
--- a/www/password-reset.php
+++ b/www/password-reset.php
@@ -1,50 +1,50 @@
<?php
# Copyright (C) 2018 Valerio Bozzolan
# Boz Libre Hosting Panel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require '../load.php';
/*
* This is the password reset page
*/
// do something
if( is_action( 'password-reset' ) ) {
die( "Apologies. This feature is not ready :(" );
if( is_logged() ) {
send_email( __( "Password reset" ), $message, $to = false );
} else {
send_email( __( "Password reset" ), $message, $to = false );
}
}
// spawn header
Header::spawn();
?>
<form method="post">
<?php if( ! is_logged() ): ?>
<div class="form-group">
- <label for="user-uid"><?php _e( "Username" ) ?></label>
- <input type="text" class="form-control" name="user_uid" id="user-uid" placeholder="<?php _e( "foo.bar" ) ?>"<?php _value( @ $_REQUEST[ 'user_uid' ] ) ?> />
+ <label for="user-uid"><?= __( "Username" ) ?></label>
+ <input type="text" class="form-control" name="user_uid" id="user-uid" placeholder="<?= __( "foo.bar" ) ?>"<?php echo value( @ $_REQUEST[ 'user_uid' ] ) ?> />
</div>
<?php endif ?>
- <button type="submit" class="btn btn-default" name="action" value="password-reset"><?php _e( "Proceed" ) ?></button>
+ <button type="submit" class="btn btn-default" name="action" value="password-reset"><?= __( "Proceed" ) ?></button>
</form>
<?php
// spawn footer
Footer::spawn();

File Metadata

Mime Type
text/x-diff
Expires
Thu, Nov 19, 04:44 (8 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2264797
Default Alt Text
(9 KB)

Event Timeline