personal.php 13 KB

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