1
0

personal.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <?php /**
  2. * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
  3. * This file is licensed under the Affero General Public License version 3 or later.
  4. * See the COPYING-README file.
  5. */
  6. /** @var $_ mixed[]|\OCP\IURLGenerator[] */
  7. /** @var \OC_Defaults $theme */
  8. ?>
  9. <div id="app-navigation">
  10. <ul>
  11. <?php foreach($_['forms'] as $form) {
  12. if (isset($form['anchor'])) {
  13. $anchor = '#' . $form['anchor'];
  14. $sectionName = $form['section-name'];
  15. print_unescaped(sprintf("<li><a href='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor), \OCP\Util::sanitizeHTML($sectionName)));
  16. }
  17. }?>
  18. </ul>
  19. </div>
  20. <div id="app-content">
  21. <div id="quota" class="section">
  22. <div style="width:<?php p($_['usage_relative']);?>%"
  23. <?php if($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
  24. <p id="quotatext">
  25. <?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
  26. array($_['usage'], $_['total_space'])));?>
  27. </p>
  28. </div>
  29. </div>
  30. <div id="personal-settings">
  31. <?php if ($_['enableAvatars']): ?>
  32. <div id="personal-settings-avatar-container">
  33. <form id="avatarform" class="section" method="post" action="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.postAvatar')); ?>">
  34. <h2>
  35. <label><?php p($l->t('Profile picture')); ?></label>
  36. <span class="icon-password"/>
  37. </h2>
  38. <div id="displayavatar">
  39. <div class="avatardiv"></div>
  40. <div class="warning hidden"></div>
  41. <?php if ($_['avatarChangeSupported']): ?>
  42. <label for="uploadavatar" class="inlineblock button icon-upload svg" id="uploadavatarbutton" title="<?php p($l->t('Upload new')); ?>"></label>
  43. <div class="inlineblock button icon-folder svg" id="selectavatar" title="<?php p($l->t('Select from Files')); ?>"></div>
  44. <div class="hidden button icon-delete svg" id="removeavatar" title="<?php p($l->t('Remove image')); ?>"></div>
  45. <input type="file" name="files[]" id="uploadavatar" class="hiddenuploadfield">
  46. <p><em><?php p($l->t('png or jpg, max. 20 MB')); ?></em></p>
  47. <?php else: ?>
  48. <?php p($l->t('Picture provided by original account')); ?>
  49. <?php endif; ?>
  50. </div>
  51. <div id="cropper" class="hidden">
  52. <div class="inner-container">
  53. <div class="inlineblock button" id="abortcropperbutton"><?php p($l->t('Cancel')); ?></div>
  54. <div class="inlineblock button primary" id="sendcropperbutton"><?php p($l->t('Choose as profile picture')); ?></div>
  55. </div>
  56. </div>
  57. <span class="icon-checkmark hidden"/>
  58. <input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
  59. </form>
  60. </div>
  61. <?php endif; ?>
  62. <?php
  63. if($_['displayNameChangeSupported']) {
  64. ?>
  65. <div id="personal-settings-container">
  66. <div class="personal-settings-setting-box">
  67. <form id="displaynameform" class="section">
  68. <h2>
  69. <label for="displayname"><?php p($l->t('Full name')); ?></label>
  70. <span class="icon-password"/>
  71. </h2>
  72. <input type="text" id="displayname" name="displayname"
  73. value="<?php p($_['displayName']) ?>"
  74. autocomplete="on" autocapitalize="off" autocorrect="off" />
  75. <span class="icon-checkmark hidden"/>
  76. <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
  77. </form>
  78. </div>
  79. <div class="personal-settings-setting-box">
  80. <form id="emailform" class="section">
  81. <h2>
  82. <label for="email"><?php p($l->t('Email')); ?></label>
  83. <span class="icon-password"/>
  84. </h2>
  85. <input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
  86. placeholder="<?php p($l->t('Your email address')); ?>"
  87. autocomplete="on" autocapitalize="off" autocorrect="off" />
  88. <br />
  89. <em><?php p($l->t('For password recovery and notifications')); ?></em>
  90. <span class="icon-checkmark hidden"/>
  91. <input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
  92. </form>
  93. </div>
  94. <div class="personal-settings-setting-box">
  95. <form id="phoneform" class="section">
  96. <h2>
  97. <label for="phone"><?php p($l->t('Phone number')); ?></label>
  98. <span class="icon-password"/>
  99. </h2>
  100. <input type="tel" id="phone" name="phone"
  101. value="<?php p($_['phone']) ?>"
  102. placeholder="<?php p($l->t('Your phone number')); ?>"
  103. autocomplete="on" autocapitalize="off" autocorrect="off" />
  104. <span class="icon-checkmark hidden"/>
  105. <input type="hidden" id="phonescope" value="<?php p($_['phoneScope']) ?>">
  106. </form>
  107. </div>
  108. <div class="personal-settings-setting-box">
  109. <form id="addressform" class="section">
  110. <h2>
  111. <label for="address"><?php p($l->t('Address')); ?></label>
  112. <span class="icon-password"/>
  113. </h2>
  114. <input type="text" id="address" name="address"
  115. placeholder="<?php p($l->t('Your postal address')); ?>"
  116. value="<?php p($_['address']) ?>"
  117. autocomplete="on" autocapitalize="off" autocorrect="off" />
  118. <span class="icon-checkmark hidden"/>
  119. <input type="hidden" id="addressscope" value="<?php p($_['addressScope']) ?>">
  120. </form>
  121. </div>
  122. <div class="personal-settings-setting-box">
  123. <form id="websiteform" class="section">
  124. <h2>
  125. <label for="website"><?php p($l->t('Website')); ?></label>
  126. <span class="icon-password"/>
  127. </h2>
  128. <input type="text" name="website" id="website" value="<?php p($_['website']); ?>"
  129. placeholder="<?php p($l->t('Your website')); ?>"
  130. autocomplete="on" autocapitalize="off" autocorrect="off" />
  131. <span class="icon-checkmark hidden"/>
  132. <input type="hidden" id="websitescope" value="<?php p($_['websiteScope']) ?>">
  133. </form>
  134. </div>
  135. <div class="personal-settings-setting-box">
  136. <form id="twitterform" class="section">
  137. <h2>
  138. <label for="twitter"><?php p($l->t('Twitter')); ?></label>
  139. <span class="icon-password"/>
  140. </h2>
  141. <input type="text" name="twitter" id="twitter" value="<?php p($_['twitter']); ?>"
  142. placeholder="<?php p($l->t('Your Twitter handle')); ?>"
  143. autocomplete="on" autocapitalize="off" autocorrect="off" />
  144. <span class="icon-checkmark hidden"/>
  145. <input type="hidden" id="twitterscope" value="<?php p($_['twitterScope']) ?>">
  146. </form>
  147. </div>
  148. <span class="msg"></span>
  149. </div>
  150. <?php
  151. } else {
  152. ?>
  153. <div id="personal-settings-container" class="no-edit">
  154. <div id="displaynameform" class="section">
  155. <h2><?php p($l->t('Full name'));?></h2>
  156. <span><?php if(isset($_['displayName'][0])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
  157. </div>
  158. <div id="emailform" class="section">
  159. <h2><?php p($l->t('Email')); ?></h2>
  160. <span><?php if(isset($_['email'][0])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
  161. </div>
  162. <div id="phoneform" class="section">
  163. <h2><?php p($l->t('Phone')); ?></h2>
  164. <span><?php if(isset($_['phone'][0])) { p($_['phone']); } else { p($l->t('No phone number set')); }?></span>
  165. </div>
  166. <div id="addressform" class="section">
  167. <h2><?php p($l->t('Address')); ?></h2>
  168. <span><?php if(isset($_['address'][0])) { p($_['address']); } else { p($l->t('No address set')); }?></span>
  169. </div>
  170. <div id="websiteform" class="section">
  171. <h2><?php p($l->t('Website')); ?></h2>
  172. <span><?php if(isset($_['website'][0])) { p($_['website']); } else { p($l->t('No website set')); }?></span>
  173. </div>
  174. <div id="twitterform" class="section">
  175. <h2><?php p($l->t('Twitter')); ?></h2>
  176. <span><?php if(isset($_['twitter'][0])) { p($_['twitter']); } else { p($l->t('No twitter handle set')); }?></span>
  177. </div>
  178. </div>
  179. <?php
  180. }
  181. ?>
  182. </div>
  183. <div id="groups" class="section">
  184. <h2><?php p($l->t('Groups')); ?></h2>
  185. <p><?php p($l->t('You are member of the following groups:')); ?></p>
  186. <p>
  187. <?php p(implode(', ', $_['groups'])); ?>
  188. </p>
  189. </div>
  190. <?php
  191. if($_['passwordChangeSupported']) {
  192. script('jquery-showpassword');
  193. ?>
  194. <form id="passwordform" class="section">
  195. <h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
  196. <div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div>
  197. <br>
  198. <label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
  199. <input type="password" id="pass1" name="oldpassword"
  200. placeholder="<?php p($l->t('Current password'));?>"
  201. autocomplete="off" autocapitalize="off" autocorrect="off" />
  202. <label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
  203. <input type="password" id="pass2" name="newpassword"
  204. placeholder="<?php p($l->t('New password')); ?>"
  205. data-typetoggle="#personal-show"
  206. autocomplete="off" autocapitalize="off" autocorrect="off" />
  207. <input type="checkbox" id="personal-show" name="show" /><label for="personal-show" class="personal-show-label"></label>
  208. <input id="passwordbutton" type="submit" value="<?php p($l->t('Change password')); ?>" />
  209. <br/>
  210. </form>
  211. <?php
  212. }
  213. ?>
  214. <form id="language" class="section">
  215. <h2>
  216. <label for="languageinput"><?php p($l->t('Language'));?></label>
  217. </h2>
  218. <select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
  219. <option value="<?php p($_['activelanguage']['code']);?>">
  220. <?php p($_['activelanguage']['name']);?>
  221. </option>
  222. <?php foreach($_['commonlanguages'] as $language):?>
  223. <option value="<?php p($language['code']);?>">
  224. <?php p($language['name']);?>
  225. </option>
  226. <?php endforeach;?>
  227. <optgroup label="––––––––––"></optgroup>
  228. <?php foreach($_['languages'] as $language):?>
  229. <option value="<?php p($language['code']);?>">
  230. <?php p($language['name']);?>
  231. </option>
  232. <?php endforeach;?>
  233. </select>
  234. <a href="https://www.transifex.com/nextcloud/nextcloud/"
  235. target="_blank" rel="noreferrer">
  236. <em><?php p($l->t('Help translate'));?></em>
  237. </a>
  238. </form>
  239. <div id="clientsbox" class="section clientsbox">
  240. <h2><?php p($l->t('Get the apps to sync your files'));?></h2>
  241. <a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
  242. <img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
  243. alt="<?php p($l->t('Desktop client'));?>" />
  244. </a>
  245. <a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
  246. <img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
  247. alt="<?php p($l->t('Android app'));?>" />
  248. </a>
  249. <a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
  250. <img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
  251. alt="<?php p($l->t('iOS app'));?>" />
  252. </a>
  253. <p>
  254. <?php print_unescaped(str_replace(
  255. [
  256. '{contributeopen}',
  257. '{linkclose}',
  258. ],
  259. [
  260. '<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer">',
  261. '</a>',
  262. ],
  263. $l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
  264. </p>
  265. <?php if(OC_APP::isEnabled('firstrunwizard')) {?>
  266. <p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
  267. <?php }?>
  268. </div>
  269. <div id="sessions" class="section">
  270. <h2><?php p($l->t('Sessions'));?></h2>
  271. <span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.'));?></span>
  272. <table class="icon-loading">
  273. <thead class="token-list-header">
  274. <tr>
  275. <th><?php p($l->t('Device'));?></th>
  276. <th><?php p($l->t('Last activity'));?></th>
  277. <th></th>
  278. </tr>
  279. </thead>
  280. <tbody class="token-list">
  281. </tbody>
  282. </table>
  283. </div>
  284. <div id="apppasswords" class="section">
  285. <h2><?php p($l->t('App passwords'));?></h2>
  286. <p><?php p($l->t('Passcodes that give an app or device permissions to access your account.'));?></p>
  287. <table class="icon-loading">
  288. <thead class="hidden-when-empty">
  289. <tr>
  290. <th><?php p($l->t('Name'));?></th>
  291. <th><?php p($l->t('Last activity'));?></th>
  292. <th></th>
  293. </tr>
  294. </thead>
  295. <tbody class="token-list">
  296. </tbody>
  297. </table>
  298. <div id="app-password-form">
  299. <input id="app-password-name" type="text" placeholder="<?php p($l->t('App name')); ?>">
  300. <button id="add-app-password" class="button"><?php p($l->t('Create new app password')); ?></button>
  301. </div>
  302. <div id="app-password-result" class="hidden">
  303. <span>
  304. <?php p($l->t('Use the credentials below to configure your app or device.')); ?>
  305. <?php p($l->t('For security reasons this password will only be shown once.')); ?>
  306. </span>
  307. <div class="app-password-row">
  308. <span class="app-password-label"><?php p($l->t('Username')); ?></span>
  309. <input id="new-app-login-name" type="text" readonly="readonly"/>
  310. </div>
  311. <div class="app-password-row">
  312. <span class="app-password-label"><?php p($l->t('Password')); ?></span>
  313. <input id="new-app-password" type="text" readonly="readonly"/>
  314. <a class="clipboardButton icon icon-clippy" data-clipboard-target="#new-app-password"></a>
  315. <button id="app-password-hide" class="button"><?php p($l->t('Done')); ?></button>
  316. </div>
  317. </div>
  318. </div>
  319. <?php foreach($_['forms'] as $form) {
  320. if (isset($form['form'])) {?>
  321. <div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
  322. <?php }
  323. };?>
  324. <div class="section">
  325. <h2><?php p($l->t('Version'));?></h2>
  326. <p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
  327. <p><?php include('settings.development.notice.php'); ?></p>
  328. </div>
  329. </div>