move config.php and install to root

This commit is contained in:
Ibnu Maksum 2022-09-19 09:31:35 +07:00
parent ac813ca132
commit 335c5e524b
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
18 changed files with 365 additions and 363 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
system/config.php
config.php
.DS_Store
.vscode/
ui/compiled/*.php

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -17,10 +17,10 @@ function r2($to, $ntype = 'e', $msg = '')
exit;
}
if (file_exists('system/config.php')) {
require('system/config.php');
if (file_exists('config.php')) {
require('config.php');
} else {
r2('system/install');
r2('install');
}
@ -220,8 +220,7 @@ function _admin($login = true)
function _raid($l)
{
$r = substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l);
return $r;
return substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l);
}
function _log($description, $type = '', $userid = '0')
@ -263,6 +262,7 @@ function alphanumeric($str, $tambahan = "")
function sendTelegram($txt)
{
global $_c;
run_hook('send_telegram'); #HOOK
if (!empty($_c['telegram_bot']) && !empty($_c['telegram_target_id'])) {
file_get_contents('https://api.telegram.org/bot' . $_c['telegram_bot'] . '/sendMessage?chat_id=' . $_c['telegram_target_id'] . '&text=' . urlencode($txt));
}
@ -272,6 +272,7 @@ function sendTelegram($txt)
function sendSMS($phone, $txt)
{
global $_c;
run_hook('send_sms'); #HOOK
if (!empty($_c['sms_url'])) {
$smsurl = str_replace('[number]', urlencode($phone), $_c['sms_url']);
$smsurl = str_replace('[text]', urlencode($txt), $smsurl);
@ -282,6 +283,7 @@ function sendSMS($phone, $txt)
function sendWhatsapp($phone, $txt)
{
global $_c;
run_hook('send_whatsapp'); #HOOK
if (!empty($_c['wa_url'])) {
$waurl = str_replace('[number]', urlencode($phone), $_c['wa_url']);
$waurl = str_replace('[text]', urlencode($txt), $waurl);

View File

@ -3,7 +3,7 @@
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
require('config.php');
require('../config.php');
require('orm.php');
use PEAR2\Net\RouterOS;

View File

@ -7,7 +7,7 @@ if(php_sapi_name() !== 'cli'){
die("RUN ON COMMAND LINE ONLY BY RADIUS ENGINE");
}
require(__DIR__.'/config.php');
require(__DIR__.'/../config.php');
require(__DIR__.'/orm.php');
use PEAR2\Net\RouterOS;