2019-05-09 18:54:39 +12:00
<?php
2019-08-07 00:22:54 +12:00
2019-05-09 18:54:39 +12:00
use Utopia\Locale\Locale;
?>
< div class = "cover" >
< h1 class = "zone xl margin-bottom-large margin-top" >
<?php echo Locale :: getText ( 'console.account.title' ); ?>
< / h1 >
< / div >
< div class = "zone xl" >
2019-05-09 20:23:22 +12:00
< ul class = "phases clear" data-ui-phases data-selected = "{{router.params.tab}}" >
2019-05-09 18:54:39 +12:00
< li data-state = "/console/account" >
2019-08-08 17:09:49 +12:00
< div
data-service="account.get"
data-scope="console"
data-name="account"
data-event="load"
data-failure="trigger"
data-failure-param-trigger-events="logout">
2019-05-09 18:54:39 +12:00
< h2 >< span class = "number" >< i class = "icon-user" ></ i ></ span > <?php echo Locale :: getText ( 'console.account.section.overview.title' ); ?> </ h2 >
< div class = "row responsive" >
< div class = "col span-9" >
< div class = "box margin-bottom-xl" >
< div >
2019-08-08 17:09:49 +12:00
< form name = "account.update"
data-service="account.updateName"
data-scope="console"
data-event="submit"
data-success="trigger,alert"
data-success-param-alert-text="Your name was updated successfully"
data-success-param-trigger-events="account.update,modal-close"
data-failure="alert"
2019-08-09 01:43:24 +12:00
data-failure-param-alert-text="Failed to update your name"
data-failure-param-alert-classname="error">
2019-05-09 18:54:39 +12:00
< label for = "name" > <?php echo Locale :: getText ( 'console.account.section.overview.labels.name' ); ?> </ label >
< div class = "row" >
< div class = "col span-8" >
2019-05-10 04:15:51 +12:00
< input name = "name" id = "name" type = "text" autocomplete = "off" data-ls-bind = "{{account.name}}" required class = "margin-bottom-no" >
2019-05-09 18:54:39 +12:00
< / div >
< div class = "col span-4" >
< button type = "submit" class = "fill reverse" > <?php echo Locale :: getText ( 'console.account.section.overview.actions.update-name' ); ?> </ button >
< / div >
< / div >
< footer class = "clear" >
< / footer >
< / form >
< / div >
< hr / >
2019-08-08 17:09:49 +12:00
< form name = "update-email"
data-service="account.updateEmail"
data-scope="console"
data-event="submit"
data-success="trigger,alert"
data-success-param-alert-text="Email address updated successfully"
data-success-param-trigger-events="account-update,modal-close"
data-failure="alert"
2019-08-09 01:43:24 +12:00
data-failure-param-alert-text="Failed updating email address"
data-failure-param-alert-classname="error">
2019-05-09 18:54:39 +12:00
< label > <?php echo Locale :: getText ( 'console.account.section.overview.labels.email' ); ?> </ label >
< div class = "row" >
< div class = "col span-8" >
2019-05-10 04:15:51 +12:00
< input name = "email" type = "email" class = "margin-bottom-no" autocomplete = "off" placeholder = "me@example.com" data-ls-bind = "{{account.email}}" required >
2019-05-09 18:54:39 +12:00
< / div >
< div class = "col span-4" >
< div data-ui-modal class = "modal close width-small height-small" data-button-text = " <?php echo $this -> escape ( Locale :: getText ( 'console.account.section.overview.actions.update-email' )); ?> " data-button-class = "fill reverse" >
< label > <?php echo Locale :: getText ( 'console.account.section.overview.labels.password' ); ?> </ label >
< input name = "password" type = "password" class = "full-width" autocomplete = "off" placeholder = "" required >
< footer >
2019-05-13 08:27:33 +12:00
< button type = "submit" > <?php echo Locale :: getText ( 'console.account.section.overview.actions.update' ); ?> </ button > < button data-ui-modal-close = "" type = "button" class = "reverse" > <?php echo Locale :: getText ( 'console.account.section.overview.actions.cancel' ); ?> </ button >
2019-05-09 18:54:39 +12:00
< / footer >
< / div >
< / div >
< / div >
< / form >
< hr / >
< div data-ui-modal class = "modal close width-small" data-button-text = " <?php echo $this -> escape ( Locale :: getText ( 'console.account.section.overview.actions.update-password' )); ?> " data-button-class = "reverse" >
< h1 > <?php echo Locale :: getText ( 'console.account.section.overview.actions.update-password' ); ?> </ h1 >
2019-08-08 17:09:49 +12:00
< form name = "update-password"
data-service="account.updatePassword"
data-scope="console"
data-event="submit"
data-success="trigger,alert"
data-success-param-trigger-events="account-update,modal-close"
data-success-param-alert-text="Password updated successfully"
data-failure="alert"
2019-08-09 01:43:24 +12:00
data-failure-param-alert-text="Failed updating password"
data-failure-param-alert-classname="error">
2019-05-09 18:54:39 +12:00
< label > <?php echo Locale :: getText ( 'console.account.section.overview.labels.password1' ); ?> </ label >
< input name = "oldPassword" type = "password" class = "full-width" autocomplete = "off" placeholder = "" required >
< label > <?php echo Locale :: getText ( 'console.account.section.overview.labels.password2' ); ?> </ label >
< input name = "password" type = "password" class = "full-width" autocomplete = "off" placeholder = "" required data-forms-password-meter >
< footer >
2019-05-13 08:27:33 +12:00
< button type = "submit" > <?php echo Locale :: getText ( 'console.account.section.overview.actions.update-password' ); ?> </ button > < button data-ui-modal-close = "" type = "button" class = "reverse" > <?php echo Locale :: getText ( 'console.account.section.overview.actions.cancel' ); ?> </ button >
2019-05-09 18:54:39 +12:00
< / footer >
< / form >
< / div >
< hr / >
2019-08-08 17:09:49 +12:00
< form class = "margin-top"
data-service="auth.logout"
data-scope="console"
data-event="submit"
data-success="trigger"
data-success-param-trigger-events="logout"
data-failure="alert"
2019-08-09 01:43:24 +12:00
data-failure-param-alert-text="Logout failed"
data-failure-param-alert-classname="error">
2019-05-09 18:54:39 +12:00
< button class = "fill danger icon fill" >< i class = "icon-login" ></ i > <?php echo Locale :: getText ( 'console.account.section.overview.actions.logout' ); ?> </ button >
< / form >
< / div >
< / div >
2019-08-12 09:52:36 +12:00
< div class = "col span-3 text-align-center" >
2019-08-09 17:03:41 +12:00
< img src = "" data-ls-attrs = "src={{account|gravatar}}" data-size = "200" height = "150" alt = "User Avatar" class = "avatar huge huge margin-bottom-small" / >
2019-05-09 18:54:39 +12:00
< br / >
< a href = "https://en.gravatar.com/gravatars/new/" rel = "noopener" class = "button margin-bottom-small" target = "_blank" >< i class = "icon-upload" ></ i > <?php echo Locale :: getText ( 'console.account.section.overview.actions.update-avatar' ); ?> </ a >
< br / >
< small class = "text-size-small" > (<?php echo Locale :: getText ( 'console.account.section.overview.actions.update-avatar-via' ); ?> < a href = "https://gravatar.com/" target = "_blank" rel = "noopener" > gravatar.com < i class = "icon-link-ext" ></ i ></ a > )</ small >
< / div >
< / div >
< div class = "row responsive" >
< div class = "col span-9" >
< h3 class = "text-danger" > <?php echo Locale :: getText ( 'console.account.section.overview.danger.title' ); ?> </ h3 >
< div class = "box danger" >
< p > <?php echo Locale :: getText ( 'console.account.section.overview.danger.subtitle' ); ?> </ p >
< p > <?php echo Locale :: getText ( 'console.account.section.overview.danger.disclaimer' ); ?> </ p >
< p > <?php echo Locale :: getText ( 'console.account.section.overview.danger.note' ); ?> </ p >
2019-08-08 17:09:49 +12:00
< form class = "inline"
data-service="account.deactivate"
data-scope="console"
data-event="submit"
data-confirm="Are you sure you want to delete your account?"
data-success="trigger"
data-success-param-trigger-events="deactivated"
data-failure="alert"
2019-08-09 01:43:24 +12:00
data-failure-param-alert-text="Account deactivation failed"
data-failure-param-alert-classname="error">
2019-05-09 18:54:39 +12:00
< button class = "danger reverse" > <?php echo Locale :: getText ( 'console.account.section.overview.danger.action' ); ?> </ button >
< / form >
< / div >
< / div >
< div class = "col span-3" > < / div >
< / div >
< / div >
< / li >
< li data-state = "/console/account/security" >
< h2 >< span class = "number" >< i class = "icon-shield" ></ i ></ span > <?php echo Locale :: getText ( 'console.account.section.security.title' ); ?> </ h2 >
< h3 > <?php echo Locale :: getText ( 'console.account.section.security.devices.title' ); ?> </ h3 >
2019-08-08 17:09:49 +12:00
< div class = "box margin-bottom"
data-service="account.getSessions"
data-scope="console"
data-name="sessions"
2019-08-08 18:10:57 +12:00
data-event="load,session-delete">
2019-05-09 18:54:39 +12:00
< ul data-ls-loop = "sessions" data-ls-as = "session" class = "list" >
< li class = "clear" >
2019-08-07 00:22:54 +12:00
< span data-ls-if = "true != {{session.current}}" style = "display: none;" >
<!-- From remote session ( - logout event) -->
2019-08-08 17:09:49 +12:00
< form class = "pull-end"
data-service="auth.logoutBySession"
data-scope="console"
data-event="submit"
data-loading="<?php echo $this -> escape ( Locale :: getText ( 'general.loading' )); ?> "
data-success="trigger"
2019-08-08 18:10:57 +12:00
data-success-param-trigger-events="session-delete"
2019-08-08 17:09:49 +12:00
data-failure="alert"
2019-08-09 01:43:24 +12:00
data-failure-param-alert-text="<?php echo $this -> escape ( Locale :: getText ( 'console.account.section.security.devices.logout.failure' )); ?> "
data-failure-param-alert-classname="error">
2019-08-07 08:38:47 +12:00
< input type = "hidden" name = "id" data-ls-bind = "{{session.id}}" >
2019-05-09 18:54:39 +12:00
< button class = "danger" > <?php echo Locale :: getText ( 'console.account.section.security.devices.logout' ); ?> </ button >
< / form >
< / span >
2019-08-07 00:22:54 +12:00
< span data-ls-if = "true == {{session.current}}" style = "display: none;" >
<!-- From current session (+logout event) -->
2019-08-08 17:09:49 +12:00
< form class = "pull-end"
data-service="auth.logoutBySession"
data-scope="console"
data-event="submit"
data-loading="<?php echo $this -> escape ( Locale :: getText ( 'general.loading' )); ?> "
data-success="trigger,redirect"
data-success-param-trigger-events="logout"
data-success-param-redirect-url="/"
data-failure="alert"
2019-08-09 01:43:24 +12:00
data-failure-param-alert-text="<?php echo $this -> escape ( Locale :: getText ( 'console.account.section.security.devices.logout.failure' )); ?> "
data-failure-param-alert-classname="error">
2019-08-07 08:38:47 +12:00
< input type = "hidden" name = "id" data-ls-bind = "{{session.id}}" >
2019-05-09 18:54:39 +12:00
< button class = "danger" > <?php echo Locale :: getText ( 'console.account.section.security.devices.logout' ); ?> </ button >
< / form >
< / span >
2019-08-11 07:05:36 +12:00
< img data-ls-attrs = "src={{env.API}}/avatars/browsers/{{session.client.short_name|lowercase}}?width=120&height=120,title={{session.client.name}},alt={{session.client.name}}" class = "avatar trans pull-start margin-end" / >
2019-05-09 18:54:39 +12:00
2019-05-10 04:15:51 +12:00
< span data-ls-bind = "{{session.client.name}}" > < / span > < span data-ls-bind = "{{session.client.version}}" > < / span > on < span data-ls-bind = "{{session.model}}" > < / span > < span data-ls-bind = "{{session.OS.name}}" > < / span > < span data-ls-bind = "{{session.OS.version}}" > < / span >
2019-05-09 18:54:39 +12:00
< span data-ls-if = "true == {{session.current}}" style = "display: none;" >
< span class = "tag green" > <?php echo Locale :: getText ( 'console.account.section.security.devices.current' ); ?> </ span >
< / span >
< div class = "note info margin-top-small" >
2019-08-08 01:02:14 +12:00
< img data-ls-attrs = "src={{env.API}}/avatars/flags/{{session.geo.isoCode}}?width=80&height=80" class = "avatar xs margin-end-small inline" / >
2019-05-10 04:15:51 +12:00
< small data-ls-bind = "{{session.ip}}" > < / small > / < small data-ls-bind = "{{session.geo.country}}" > < / small >
2019-05-09 18:54:39 +12:00
< / div >
< / li >
< / ul >
< / div >
2019-08-08 17:09:49 +12:00
< form class = "inline margin-bottom-large"
data-service="auth.logoutBySession"
data-scope="console"
data-event="submit"
data-success="trigger,redirect"
2019-08-08 18:10:57 +12:00
data-success-param-trigger-events="session-delete"
2019-08-08 17:09:49 +12:00
data-success-redirect-url="/"
data-failure="alert"
2019-08-09 01:43:24 +12:00
data-failure-param-alert-text="<?php echo $this -> escape ( Locale :: getText ( 'console.account.section.security.devices.logout-all' )); ?> "
data-failure-param-alert-classname="error">
2019-08-07 08:38:47 +12:00
< input type = "hidden" name = "id" value = "0" >
2019-05-09 18:54:39 +12:00
< button class = "danger" > <?php echo Locale :: getText ( 'console.account.section.security.devices.logout-all' ); ?> </ button >
< / form >
2019-08-08 17:09:49 +12:00
< div class = "account"
data-service="account.getSecurity"
data-scope="console"
data-name="securityLogs"
data-event="load">
2019-05-10 07:30:30 +12:00
< span data-ls-bind = "{{securityLogs}}" > < / span >
2019-05-09 18:54:39 +12:00
< h3 > <?php echo Locale :: getText ( 'console.account.section.security.recent-activity.title' ); ?> </ h3 >
< div class = "box" >
< table class = "vertical small" >
< thead >
2019-08-07 00:22:54 +12:00
< tr >
< th width = "140" > <?php echo Locale :: getText ( 'console.account.section.security.recent-activity.date' ); ?> </ th >
< th width = "175" > <?php echo Locale :: getText ( 'console.account.section.security.recent-activity.event' ); ?> </ th >
< th > <?php echo Locale :: getText ( 'console.account.section.security.recent-activity.client' ); ?> </ th >
< th width = "90" > <?php echo Locale :: getText ( 'console.account.section.security.recent-activity.location' ); ?> </ th >
< th width = "90" > <?php echo Locale :: getText ( 'console.account.section.security.recent-activity.ip' ); ?> </ th >
< / tr >
2019-05-09 18:54:39 +12:00
< / thead >
< tbody data-ls-loop = "securityLogs" data-ls-as = "log" >
2019-08-07 00:22:54 +12:00
< tr >
< td data-title = " <?php echo $this -> escape ( Locale :: getText ( 'console.account.section.security.recent-activity.date' )); ?> : " >< span data-ls-bind = "{{log.time|date-time}}" ></ span ></ td >
< td data-title = " <?php echo $this -> escape ( Locale :: getText ( 'console.account.section.security.recent-activity.event' )); ?> : " >< span data-ls-bind = "{{log.event}}" ></ span ></ td >
< td data-title = " <?php echo $this -> escape ( Locale :: getText ( 'console.account.section.security.recent-activity.client' )); ?> : " >
2019-08-11 07:05:36 +12:00
< img data-ls-attrs = "src={{env.API}}/avatars/browsers/{{log.client.short_name|lowercase}}?width=80&height=80,title={{log.client.name}},alt={{log.client.name}}" class = "avatar xs inline margin-end-small" / >
2019-08-07 00:22:54 +12:00
< span data-ls-bind = "{{log.client.name}} {{log.client.version}} on {{log.model}} {{log.OS.name}} {{log.OS.version}}" > < / span >
< / td >
< td data-title = " <?php echo $this -> escape ( Locale :: getText ( 'console.account.section.security.recent-activity.location' )); ?> : " >
2019-08-08 01:02:14 +12:00
< img data-ls-attrs = "src={{env.API}}/avatars/flags/{{log.geo.isoCode}}?width=80&height=80" class = "avatar xs inline margin-end-small" / >
2019-08-07 00:22:54 +12:00
< span data-ls-bind = "{{log.geo.country}}" > < / span >
< / td >
< td data-title = " <?php echo $this -> escape ( Locale :: getText ( 'console.account.section.security.recent-activity.ip' )); ?> : " >< span data-ls-bind = "{{log.ip}}" ></ span ></ td >
< / tr >
2019-05-09 18:54:39 +12:00
< / tbody >
< / table >
< / div >
< / div >
< / li >
< / ul >
< / div >