File inc/totp.inc.php changed (mode: 100644) (index a7d5d1a..733c5cf) |
... |
... |
function rg_totp_verify($key, $ts, $token) |
150 |
150 |
*/ |
*/ |
151 |
151 |
function rg_totp_png($secret) |
function rg_totp_png($secret) |
152 |
152 |
{ |
{ |
153 |
|
global $rg_ssh_host; |
|
|
153 |
|
global $rg; |
154 |
154 |
|
|
155 |
155 |
$extra = urlencode(gmdate('Y-m-d H:i')); |
$extra = urlencode(gmdate('Y-m-d H:i')); |
156 |
156 |
$secret = urlencode($secret); |
$secret = urlencode($secret); |
157 |
|
$issuer = urlencode($rg_ssh_host); |
|
|
157 |
|
$issuer = urlencode($rg['hostname']); |
158 |
158 |
$cmd = "qrencode -o - --level=H --type=PNG 'otpauth://totp/$extra?secret=$secret&issuer=$issuer'"; |
$cmd = "qrencode -o - --level=H --type=PNG 'otpauth://totp/$extra?secret=$secret&issuer=$issuer'"; |
159 |
159 |
$a = rg_exec($cmd, '', FALSE, FALSE, FALSE); |
$a = rg_exec($cmd, '', FALSE, FALSE, FALSE); |
160 |
160 |
if ($a['ok'] != 1) |
if ($a['ok'] != 1) |
|
... |
... |
function rg_totp_png($secret) |
168 |
168 |
*/ |
*/ |
169 |
169 |
function rg_totp_text($secret) |
function rg_totp_text($secret) |
170 |
170 |
{ |
{ |
171 |
|
global $rg_ssh_host; |
|
|
171 |
|
global $rg; |
172 |
172 |
|
|
173 |
173 |
$extra = urlencode(gmdate('Y-m-d H:i')); |
$extra = urlencode(gmdate('Y-m-d H:i')); |
174 |
174 |
$secret = urlencode($secret); |
$secret = urlencode($secret); |
175 |
|
$issuer = urlencode($rg_ssh_host); |
|
|
175 |
|
$issuer = urlencode($rg['hostname']); |
176 |
176 |
$cmd = "qrencode -o - --level=M --margin=2 --type=UTF8" |
$cmd = "qrencode -o - --level=M --margin=2 --type=UTF8" |
177 |
177 |
. " 'otpauth://totp/$extra?secret=$secret&issuer=$issuer'"; |
. " 'otpauth://totp/$extra?secret=$secret&issuer=$issuer'"; |
178 |
178 |
$a = rg_exec($cmd, '', FALSE, FALSE, FALSE); |
$a = rg_exec($cmd, '', FALSE, FALSE, FALSE); |
File scripts/cron.php changed (mode: 100644) (index 471e832..3f1bf33) |
... |
... |
if (empty($first_install)) { |
53 |
53 |
exit(0); |
exit(0); |
54 |
54 |
} |
} |
55 |
55 |
|
|
56 |
|
$hostname = rg_state_get($db, 'hostname'); |
|
57 |
|
$http_allow = rg_state_get($db, 'http_allow'); |
|
58 |
|
$https_allow = rg_state_get($db, 'https_allow'); |
|
59 |
|
rg_base_url_build($hostname, $http_allow, $https_allow); |
|
|
56 |
|
$rg['hostname'] = rg_state_get($db, 'hostname'); |
|
57 |
|
$rg['http_allow'] = rg_state_get($db, 'http_allow'); |
|
58 |
|
$rg['https_allow'] = rg_state_get($db, 'https_allow'); |
|
59 |
|
rg_base_url_build($rg['hostname'], $rg['http_allow'], $rg['https_allow']); |
|
60 |
|
$rg['base_url'] = rg_base_url(); |
60 |
61 |
rg_log('DEBUG: base_url=' . rg_base_url()); |
rg_log('DEBUG: base_url=' . rg_base_url()); |
61 |
62 |
|
|
62 |
63 |
if (gmdate("Hi") == "0105") { |
if (gmdate("Hi") == "0105") { |
File scripts/remote.php changed (mode: 100644) (index efda942..5a46ced) |
... |
... |
rg_cache_get('state'); |
76 |
76 |
if (rg_struct_ok($db) === FALSE) |
if (rg_struct_ok($db) === FALSE) |
77 |
77 |
fatal("We are in a short maintenance window. Try again later."); |
fatal("We are in a short maintenance window. Try again later."); |
78 |
78 |
|
|
79 |
|
$hostname = rg_state_get($db, 'hostname'); |
|
80 |
|
$http_allow = rg_state_get($db, 'http_allow'); |
|
81 |
|
$https_allow = rg_state_get($db, 'https_allow'); |
|
82 |
|
rg_base_url_build($hostname, $http_allow, $https_allow); |
|
|
79 |
|
$rg['hostname'] = rg_state_get($db, 'hostname'); |
|
80 |
|
$rg['http_allow'] = rg_state_get($db, 'http_allow'); |
|
81 |
|
$rg['https_allow'] = rg_state_get($db, 'https_allow'); |
|
82 |
|
rg_base_url_build($rg['hostname'], $rg['http_allow'], $rg['https_allow']); |
|
83 |
|
$rg['base_url'] = rg_base_url(); |
83 |
84 |
rg_log('DEBUG: base_url=' . rg_base_url()); |
rg_log('DEBUG: base_url=' . rg_base_url()); |
84 |
85 |
|
|
85 |
86 |
$login_ui = array('uid' => 0, |
$login_ui = array('uid' => 0, |