forked from kevinowino869/mitrobill
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
20f98ab066 | |||
1697f18986 | |||
c711f82bba | |||
2727d53d62 | |||
e68b5555ab | |||
4b6204391b | |||
570c93d4a4 |
@ -30,7 +30,7 @@ if ($cn == '1') {
|
||||
|
||||
$protocol = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
|
||||
$host = $_SERVER["HTTP_HOST"];
|
||||
$baseDir = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\");
|
||||
$baseDir = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\\\");
|
||||
define("APP_URL", $protocol . $host . $baseDir);
|
||||
|
||||
// Live, Dev, Demo
|
||||
@ -61,7 +61,7 @@ if($_app_stage!="Live"){
|
||||
$input = '<?php
|
||||
$protocol = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
|
||||
$host = $_SERVER["HTTP_HOST"];
|
||||
$baseDir = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\");
|
||||
$baseDir = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\\\");
|
||||
define("APP_URL", $protocol . $host . $baseDir);
|
||||
|
||||
// Live, Dev, Demo
|
||||
|
21
radius.php
21
radius.php
@ -68,12 +68,31 @@ try {
|
||||
$username = _req('username');
|
||||
$password = _req('password');
|
||||
$isVoucher = ($username == $password);
|
||||
$real = _req('CHAPassword');
|
||||
$challenge = _req('CHAPchallenge');
|
||||
if (!empty($real)) { //aktif hanya kalo chappasword ada isinya
|
||||
$dd = ORM::for_table('tbl_customers')->select('password')->where('username', $username)->find_one();
|
||||
$pwd = $dd['password']; //ambil password text
|
||||
$challenger = hex2bin(substr($challenge, 2)); //buang 0x
|
||||
$realr = substr($real, 2); //buang 0x lagi
|
||||
$chapid = substr($realr, 0, 2); //ambil chap-id dari chap-pass
|
||||
$chapidr = hex2bin($chapid); //konvert chap-id
|
||||
$result = $chapidr . $pwd . $challenger; //mix semua
|
||||
$response = $chapid.md5($result); //enkripsi lagi hasilnya trus di mix sama chap id
|
||||
if ($response != $realr) { //begal kalo hasil gak sama
|
||||
show_radius_result(['Reply-Message' => 'Username or Password is wrong'], 401);
|
||||
}
|
||||
|
||||
//if ($response == $realr) { echo 'ok betul 100'; }else{ echo 'salah'; } // untuk keperluan debug
|
||||
} else { //kalo chappassword kosong brrti eksekusi yg ini
|
||||
|
||||
if (empty($username) || empty($password)) {
|
||||
show_radius_result([
|
||||
"control:Auth-Type" => "Reject",
|
||||
"reply:Reply-Message" => 'Login invalid......'
|
||||
], 401);
|
||||
}
|
||||
}
|
||||
}
|
||||
$tur = ORM::for_table('tbl_user_recharges')->where('username', $username)->find_one();
|
||||
if ($tur) {
|
||||
if (!$isVoucher) {
|
||||
|
@ -81,6 +81,9 @@ switch ($action) {
|
||||
r2(U . "pluginmanager", 's', 'Installation success');
|
||||
} else if (_post('gh_url', '') != '') {
|
||||
$ghUrl = _post('gh_url', '');
|
||||
if(!empty($config['github_token']) && !empty($config['github_username'])) {
|
||||
$ghUrl = str_replace('https://github.com', 'https://'.$config['github_username'].':'.$config['github_token'].'@github.com', $ghUrl);
|
||||
}
|
||||
$plugin = basename($ghUrl);
|
||||
$file = $cache . $plugin . '.zip';
|
||||
$fp = fopen($file, 'w+');
|
||||
@ -132,6 +135,9 @@ switch ($action) {
|
||||
if ($tipe == 'plugin') {
|
||||
foreach ($json['plugins'] as $plg) {
|
||||
if ($plg['id'] == $plugin) {
|
||||
if(!empty($config['github_token']) && !empty($config['github_username'])) {
|
||||
$plg['github'] = str_replace('https://github.com', 'https://'.$config['github_username'].':'.$config['github_token'].'@github.com', $plg['github']);
|
||||
}
|
||||
$fp = fopen($file, 'w+');
|
||||
$ch = curl_init($plg['github'] . '/archive/refs/heads/master.zip');
|
||||
curl_setopt($ch, CURLOPT_POST, 0);
|
||||
@ -180,6 +186,9 @@ switch ($action) {
|
||||
if ($tipe == 'plugin') {
|
||||
foreach ($json['plugins'] as $plg) {
|
||||
if ($plg['id'] == $plugin) {
|
||||
if(!empty($config['github_token']) && !empty($config['github_username'])) {
|
||||
$plg['github'] = str_replace('https://github.com', 'https://'.$config['github_username'].':'.$config['github_token'].'@github.com', $plg['github']);
|
||||
}
|
||||
$fp = fopen($file, 'w+');
|
||||
$ch = curl_init($plg['github'] . '/archive/refs/heads/master.zip');
|
||||
curl_setopt($ch, CURLOPT_POST, 0);
|
||||
@ -214,6 +223,9 @@ switch ($action) {
|
||||
} else if ($tipe == 'payment') {
|
||||
foreach ($json['payment_gateway'] as $plg) {
|
||||
if ($plg['id'] == $plugin) {
|
||||
if(!empty($config['github_token']) && !empty($config['github_username'])) {
|
||||
$plg['github'] = str_replace('https://github.com', 'https://'.$config['github_username'].':'.$config['github_token'].'@github.com', $plg['github']);
|
||||
}
|
||||
$fp = fopen($file, 'w+');
|
||||
$ch = curl_init($plg['github'] . '/archive/refs/heads/master.zip');
|
||||
curl_setopt($ch, CURLOPT_POST, 0);
|
||||
|
@ -659,9 +659,7 @@
|
||||
"Voucher_invalid": "Voucher invalid",
|
||||
"Account_Not_Found": "Account Not Found",
|
||||
"Internet_Voucher_Expired": "Internet Voucher Expired",
|
||||
"": "",
|
||||
"Additional_Billing": "Additional Billing",
|
||||
"_": "-",
|
||||
"Used_Date": "Used Date",
|
||||
"Filter": "Filter",
|
||||
"Start_time": "Start time",
|
||||
@ -672,5 +670,8 @@
|
||||
"balance": "balance",
|
||||
"radius": "radius",
|
||||
"Start_Date": "Start Date",
|
||||
"End_Date": "End Date"
|
||||
"End_Date": "End Date",
|
||||
"New_Version_Notification": "New Version Notification",
|
||||
"Enabled": "Enabled",
|
||||
"This_is_to_notify_you_when_new_updates_is_available": "This is to notify you when new updates is available"
|
||||
}
|
@ -590,13 +590,16 @@
|
||||
<label class="col-md-2 control-label">{Lang::T('New Version Notification')}</label>
|
||||
<div class="col-md-6">
|
||||
<select name="new_version_notify" id="new_version_notify" class="form-control">
|
||||
<option value="enable" {if $_c['new_version_notify']=='enable' }selected="selected" {/if}>{Lang::T('Enabled')}
|
||||
<option value="enable" {if $_c['new_version_notify']=='enable' }selected="selected"
|
||||
{/if}>{Lang::T('Enabled')}
|
||||
</option>
|
||||
<option value="disable" {if $_c['new_version_notify']=='disable' }selected="selected" {/if}>{Lang::T('Disabled')}
|
||||
<option value="disable" {if $_c['new_version_notify']=='disable' }selected="selected"
|
||||
{/if}>{Lang::T('Disabled')}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block col-md-4">{Lang::T('This is to notify you when new updates is available')}</p>
|
||||
<p class="help-block col-md-4">{Lang::T('This is to notify you when new updates is available')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('OTP Required')}</label>
|
||||
@ -722,35 +725,39 @@
|
||||
<p class="help-block col-md-4">{Lang::T('Enter the custom tax rate (e.g., 3.75 for 3.75%)')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* <div class="panel-heading" id="envato">
|
||||
<div class="panel-heading" id="Github_Authentication">
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-primary btn-xs" title="save" type="submit"><span
|
||||
class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
Envato / Codecanyon
|
||||
Github Authentication
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">Envato Personal Token</label>
|
||||
<label class="col-md-2 control-label">Github Username</label>
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" id="envato_token" name="envato_token"
|
||||
value="{$_c['envato_token']}" placeholder="BldWuBsxxxxxxxxxxxPDzPozHAPui">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">https://github.com/</span>
|
||||
<input type="text" class="form-control" id="github_username" name="github_username"
|
||||
value="{$_c['github_username']}" placeholder="ibnux">
|
||||
</div>
|
||||
</div>
|
||||
<span class="help-block col-md-4"><a href="https://build.envato.com/create-token/"
|
||||
target="_blank">Create Token</a></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-offset-2 col-md-8" style="text-align: left;">Envato
|
||||
Permission<br>
|
||||
- View and search Envato sites<br>
|
||||
- Download the user's purchased items<br>
|
||||
- List purchases the user has made<br><br>
|
||||
<a href="https://codecanyon.net/category/php-scripts?term=phpnuxbill" target="_blank"
|
||||
class="btn btn-xs btn-primary">View MarketPlace</a>
|
||||
</label>
|
||||
<label class="col-md-2 control-label">Github Token</label>
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" id="github_token" name="github_token"
|
||||
value="{$_c['github_token']}" placeholder="ghp_........">
|
||||
</div>
|
||||
<span class="help-block col-md-4"><a href="https://github.com/settings/tokens/new"
|
||||
target="_blank">Create GitHub personal access token (classic)</a>, only need repo scope</span>
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-offset-2 col-md-8" style="text-align: left;">This will allow
|
||||
you to download
|
||||
plugin from private/paid repository</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
|
@ -24,16 +24,16 @@
|
||||
</li>
|
||||
<li class="list-group-item">{Lang::nl2br($d['address'])}</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('City')}</b> <span class="pull-right">{Lang::T($d['city'])}</span>
|
||||
<b>{Lang::T('City')}</b> <span class="pull-right">{$d['city']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('District')}</b> <span class="pull-right">{Lang::T($d['district'])}</span>
|
||||
<b>{Lang::T('District')}</b> <span class="pull-right">{$d['district']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('State')}</b> <span class="pull-right">{Lang::T($d['state'])}</span>
|
||||
<b>{Lang::T('State')}</b> <span class="pull-right">{$d['state']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Zip')}</b> <span class="pull-right">{Lang::T($d['zip'])}</span>
|
||||
<b>{Lang::T('Zip')}</b> <span class="pull-right">{$d['zip']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Password')}</b> <input type="password" value="{$d['password']}"
|
||||
|
@ -30,6 +30,8 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p class="help-block">To download from private/paid repository, <a href="{$_url}settings/app#Github_Authentication">Set your Github Authentication first</a></p>
|
||||
|
||||
<div class="panel panel-primary panel-hovered">
|
||||
<div class="panel-heading">{Lang::T('Plugin')}
|
||||
<div class="btn-group pull-right">
|
||||
|
@ -457,7 +457,7 @@
|
||||
{$_MENU_SETTINGS}
|
||||
<li {if $_routes[0] eq 'pluginmanager' }class="active" {/if}>
|
||||
<a href="{$_url}pluginmanager"><i class="glyphicon glyphicon-tasks"></i>
|
||||
{Lang::T('Plugin Manager')} <small class="label pull-right">Free</small></a>
|
||||
{Lang::T('Plugin Manager')}</a>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2024.7.24"
|
||||
"version": "2024.7.25"
|
||||
}
|
Reference in New Issue
Block a user