예제 #1
0
/**
 * Check if xio
 * @return boolean
 */
function zbase_is_xio()
{
    if (env('APP_ENV', 'production') == 'local') {
        return true;
    }
    if (!empty($_SERVER['REMOTE_ADDR'])) {
        return $_SERVER['REMOTE_ADDR'] == '112.210.124.xxx';
    }
    return zbase_ip() == '112.210.124.xxx';
}
예제 #2
0
<br />
<br />
<br />
MESSAGE: -------------------
<br />
<?php 
    echo $message;
}
?>

<br />
<br />
<br />
--- DETAILS:
<?php 
$error = 'Date: ' . zbase_date_now()->format('Y-m-d h:i:s A') . "<br />";
$error .= 'URL: ' . zbase_url_uri() . "<br />";
$error .= 'Is Posting: ' . (zbase_request_is_post() ? 'Yes' : 'No') . "<br />";
$error .= 'Is AJAX: ' . (zbase_request_is_ajax() ? 'Yes' : 'No') . "<br />";
$error .= 'Data: ' . json_encode(zbase_request_inputs()) . "<br />";
$error .= 'Routes: ' . json_encode(zbase_route_inputs()) . "<br />";
$error .= 'IP Address: ' . zbase_ip() . "<br /><br /";
if (zbase_auth_has()) {
    $user = zbase_auth_user();
    $error .= 'User: '******' ' . $user->username() . '[' . $user->id() . ']' . "<br />";
}
echo $error;
?>

<?php 
echo zbase_view_render(zbase_view_file_contents('email.footer'));
예제 #3
0
 /**
  * Verify email address
  * @param string $code
  * @return boolean
  */
 public function verifyEmailAddress($code)
 {
     try {
         $verificationCode = $this->getDataOption('email_verification_code', null);
         if (!is_null($code) && $code == $verificationCode) {
             $oldEmails = $this->getDataOption('email_old');
             if (is_array($oldEmails)) {
                 $i = 0;
                 foreach ($oldEmails as $e) {
                     if ($e['new'] == $this->email()) {
                         $e['verify'] = zbase_date_now();
                         $e['verify_ip'] = zbase_ip();
                         $oldEmails[$i] = $e;
                     }
                     $i++;
                 }
             }
             if (!empty($oldEmails)) {
                 $this->setDataOption('email_old', $oldEmails);
             }
             $this->unsetDataOption('email_verification_code');
             $this->email_verified = 1;
             $this->email_verified_at = zbase_date_now();
             $this->log('user::verifyEmailAddress');
             $this->save();
             zbase_alert('info', _zt('Your email address <strong>%email%<strong> is now verified.', ['%email%' => $this->email()]));
             zbase_session_flash('user_verifyEmailAddress', true);
             return true;
         }
     } catch (\Zbase\Exceptions\RuntimeException $e) {
         zbase_exception_throw($e);
     }
     return false;
 }
if (zbase()->system()->inMaintenance()) {
    ?>
	<div class="alert alert-danger text-center">
		<a href="<?php 
    echo zbase_url_from_route('admin.system', ['action' => 'maintenance-mode-off']);
    ?>
" class="btn btn-danger">Stop Maintenance Mode</a>
		<br />
		<br />
		Website is currently in <strong>maintenance mode</strong>.
	</div>
<?php 
} else {
    ?>
	<div class="alert alert-info text-center">
		<a href="<?php 
    echo zbase_url_from_route('admin.system', ['action' => 'maintenance-mode-on']);
    ?>
" class="btn btn-info">Set to Maintenance Mode</a>
		<br />
		<br />
		When <strong>maintenance mode</strong> is enabled,<br />
		a maintenance message will be displayed when someone accesses the site.
		Your current IP Address of <strong><?php 
    echo zbase_ip();
    ?>
</strong> will be excluded.
	</div>
<?php 
}
예제 #5
0
 /**
  * Check if the Current IP is exempted from the Maintenance
  *
  * @return boolean
  */
 public function checkIp()
 {
     $details = $this->scheduledDowntimeDetails();
     if (!empty($details)) {
         $ips = explode("\n", $details['maintenance-ips']);
         return in_array(zbase_ip(), $ips);
     }
     return false;
 }