aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-03-17 17:49:13 +0100
committerMario <mario@mariovavti.com>2021-03-17 17:49:13 +0100
commit9f26b7aa9c6e3ba50de5a0780c917cabad7367f6 (patch)
treebcc78e49cf73db9e6af6f5a11367be47b1f9f2e8
parentfebf766be0ecd2a50aa8842a90a23dc23763e373 (diff)
downloadvolse-hubzilla-9f26b7aa9c6e3ba50de5a0780c917cabad7367f6.tar.gz
volse-hubzilla-9f26b7aa9c6e3ba50de5a0780c917cabad7367f6.tar.bz2
volse-hubzilla-9f26b7aa9c6e3ba50de5a0780c917cabad7367f6.zip
air: convert utc to local in browser (we do not have a client timezone othervise at this point) - issue #1544
-rw-r--r--Zotlabs/Lib/Enotify.php6
-rw-r--r--Zotlabs/Module/Regate.php4
-rw-r--r--Zotlabs/Module/Register.php8
-rw-r--r--view/tpl/plain.tpl7
-rw-r--r--view/tpl/regate.tpl1
5 files changed, 18 insertions, 8 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 992eba000..a8fff01a3 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -976,6 +976,10 @@ class Enotify {
static public function format_register($rr) {
+ $policy = intval(get_config('system','register_policy'));
+ $message = (($rr['reg_vfd']) ? t('verified') : t('not verified'));
+ $message .= (($policy == REGISTER_APPROVE) ? ', ' . t('requires approval') : '');
+
$x = [
'notify_link' => z_root() . '/admin/accounts',
'name' => (($rr['reg_email']) ? $rr['reg_email'] : $rr['reg_did2']),
@@ -983,7 +987,7 @@ class Enotify {
'photo' => z_root() . '/' . get_default_profile_photo(48),
'when' => datetime_convert('UTC', date_default_timezone_get(),$rr['reg_created']),
'hclass' => ('notify-unseen'),
- 'message' => (($rr['reg_vfd']) ? t('verified') : t('not yet verified')) . ', ' . t('requires approval')
+ 'message' => $message
];
return $x;
diff --git a/Zotlabs/Module/Regate.php b/Zotlabs/Module/Regate.php
index 2b46d7452..7379a6662 100644
--- a/Zotlabs/Module/Regate.php
+++ b/Zotlabs/Module/Regate.php
@@ -232,8 +232,8 @@ class Regate extends \Zotlabs\Web\Controller {
$ip = $_SERVER['REMOTE_ADDR'];
$isduty = zar_register_dutystate();
- $nowfmt = $isduty['nowfmt'];
- $atform = $isduty['atform'];
+ $nowfmt = $isduty['nowfmt'];
+ $atform = $isduty['atform'];
$title = t('Register Verification');
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php
index 38bfd1619..c8cb78e74 100644
--- a/Zotlabs/Module/Register.php
+++ b/Zotlabs/Module/Register.php
@@ -320,7 +320,7 @@ class Register extends Controller {
$reonar['from'] = get_config('system', 'from_email');
$reonar['to'] = $email;
$reonar['subject'] = sprintf( t('Registration confirmation for %s'), get_config('system','sitename'));
- $reonar['txtpersonal']= t('Valid from') . ' ' . $regdelay . ' ' . t('and expire') . ' ' . $regexpire;
+ $reonar['txtpersonal']= t('Valid from') . ' <span class="register_date">' . $regdelay . '</span> ' . t('and expire') . ' <span class="register_date">' . $regexpire . '</span>';
$reonar['txttemplate']= replace_macros(get_intltext_template('register_verify_member.tpl'),
[
'$sitename' => get_config('system','sitename'),
@@ -387,11 +387,11 @@ class Register extends Controller {
zar_log( 'ZAR0239A ' . t('New register request') . ' d' . $didnew . ', '
. $regdelay . ' - ' . $regexpire);
- // notice( 'ZAR0239I,' . t( 'Your didital id is' ) . EOL . 'd' . $didnew . EOL
- $_SESSION['zar']['msg'] = ( 'ZAR0239I,' . t( 'Your didital id is' ) . EOL . 'd' . $didnew . EOL
+ // notice( 'ZAR0239I,' . t( 'Your digital id is' ) . EOL . 'd' . $didnew . EOL
+ $_SESSION['zar']['msg'] = ( 'ZAR0239I,' . t( 'Your digital id is' ) . EOL . 'd' . $didnew . EOL
. t('and your pin for is') . ' ' . $pass2 . EOL
. t('Keep these infos and your entered password safe') . EOL
- . t('Valid from') . ' ' . $regdelay . ' ' . t('and expire') . ' ' . $regexpire . EOL );
+ . t('Valid from') . ' <span class="register_date">' . datetime_convert('UTC', 'UTC', $regdelay, 'c') . '</span> ' . t('and expire') . ' <span class="register_date">' . datetime_convert('UTC', 'UTC', $regexpire, 'c') . '</span>' . EOL );
// acpin verify
// goaway(z_root() . '/regate/' . bin2hex('d' . $didnew) . 'a' );
diff --git a/view/tpl/plain.tpl b/view/tpl/plain.tpl
index 9af76718e..b01ee9baa 100644
--- a/view/tpl/plain.tpl
+++ b/view/tpl/plain.tpl
@@ -1,3 +1,10 @@
<h2>{{$title}}</h2>
{{if $now}}<div>{{$now}}</div>{{/if}}
<div style="font-weight: normal; font-family: monospace;">{{$infos}}</div>
+<script>
+ $('.register_date').each( function () {
+ var UTC = $(this).html();
+ var date = new Date(UTC);
+ $(this).html(date.toLocaleString());
+ });
+</script>
diff --git a/view/tpl/regate.tpl b/view/tpl/regate.tpl
index 38135d424..bae0884dc 100644
--- a/view/tpl/regate.tpl
+++ b/view/tpl/regate.tpl
@@ -20,4 +20,3 @@
</form>
<div class="clear"></div>
-