personal.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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. <div id="personal-settings-container">
  63. <div class="personal-settings-setting-box">
  64. <form id="displaynameform" class="section">
  65. <h2>
  66. <label for="displayname"><?php p($l->t('Full name')); ?></label>
  67. <span class="icon-password"/>
  68. </h2>
  69. <input type="text" id="displayname" name="displayname"
  70. <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
  71. value="<?php p($_['displayName']) ?>"
  72. autocomplete="on" autocapitalize="off" autocorrect="off" />
  73. <?php if(!$_['displayNameChangeSupported']) { ?>
  74. <span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
  75. <?php } ?>
  76. <span class="icon-checkmark hidden"/>
  77. <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
  78. </form>
  79. </div>
  80. <div class="personal-settings-setting-box">
  81. <form id="emailform" class="section">
  82. <h2>
  83. <label for="email"><?php p($l->t('Email')); ?></label>
  84. <span class="icon-password"/>
  85. </h2>
  86. <input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
  87. <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
  88. placeholder="<?php p($l->t('Your email address')); ?>"
  89. autocomplete="on" autocapitalize="off" autocorrect="off" />
  90. <?php if(!$_['displayNameChangeSupported']) { ?>
  91. <span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
  92. <?php } ?>
  93. <?php if($_['displayNameChangeSupported']) { ?>
  94. <br />
  95. <em><?php p($l->t('For password recovery and notifications')); ?></em>
  96. <?php } ?>
  97. <span class="icon-checkmark hidden"/>
  98. <input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
  99. </form>
  100. </div>
  101. <div class="personal-settings-setting-box">
  102. <form id="phoneform" class="section">
  103. <h2>
  104. <label for="phone"><?php p($l->t('Phone number')); ?></label>
  105. <span class="icon-password"/>
  106. </h2>
  107. <input type="tel" id="phone" name="phone"
  108. value="<?php p($_['phone']) ?>"
  109. placeholder="<?php p($l->t('Your phone number')); ?>"
  110. autocomplete="on" autocapitalize="off" autocorrect="off" />
  111. <span class="icon-checkmark hidden"/>
  112. <input type="hidden" id="phonescope" value="<?php p($_['phoneScope']) ?>">
  113. </form>
  114. </div>
  115. <div class="personal-settings-setting-box">
  116. <form id="addressform" class="section">
  117. <h2>
  118. <label for="address"><?php p($l->t('Address')); ?></label>
  119. <span class="icon-password"/>
  120. </h2>
  121. <input type="text" id="address" name="address"
  122. placeholder="<?php p($l->t('Your postal address')); ?>"
  123. value="<?php p($_['address']) ?>"
  124. autocomplete="on" autocapitalize="off" autocorrect="off" />
  125. <span class="icon-checkmark hidden"/>
  126. <input type="hidden" id="addressscope" value="<?php p($_['addressScope']) ?>">
  127. </form>
  128. </div>
  129. <div class="personal-settings-setting-box">
  130. <form id="websiteform" class="section">
  131. <h2>
  132. <label for="website"><?php p($l->t('Website')); ?></label>
  133. <span class="icon-password"/>
  134. </h2>
  135. <input type="text" name="website" id="website" value="<?php p($_['website']); ?>"
  136. placeholder="<?php p($l->t('Your website')); ?>"
  137. autocomplete="on" autocapitalize="off" autocorrect="off" />
  138. <span class="icon-checkmark hidden"/>
  139. <input type="hidden" id="websitescope" value="<?php p($_['websiteScope']) ?>">
  140. </form>
  141. </div>
  142. <div class="personal-settings-setting-box">
  143. <form id="twitterform" class="section">
  144. <h2>
  145. <label for="twitter"><?php p($l->t('Twitter')); ?></label>
  146. <span class="icon-password"/>
  147. </h2>
  148. <input type="text" name="twitter" id="twitter" value="<?php p($_['twitter']); ?>"
  149. placeholder="<?php p($l->t('Your Twitter handle')); ?>"
  150. autocomplete="on" autocapitalize="off" autocorrect="off" />
  151. <span class="icon-checkmark hidden"/>
  152. <input type="hidden" id="twitterscope" value="<?php p($_['twitterScope']) ?>">
  153. </form>
  154. </div>
  155. <span class="msg"></span>
  156. </div>
  157. </div>
  158. <div id="groups" class="section">
  159. <h2><?php p($l->t('Groups')); ?></h2>
  160. <p><?php p($l->t('You are member of the following groups:')); ?></p>
  161. <p>
  162. <?php p(implode(', ', $_['groups'])); ?>
  163. </p>
  164. </div>
  165. <?php
  166. if($_['passwordChangeSupported']) {
  167. script('jquery-showpassword');
  168. ?>
  169. <form id="passwordform" class="section">
  170. <h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
  171. <div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div>
  172. <br>
  173. <label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
  174. <input type="password" id="pass1" name="oldpassword"
  175. placeholder="<?php p($l->t('Current password'));?>"
  176. autocomplete="off" autocapitalize="off" autocorrect="off" />
  177. <label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
  178. <input type="password" id="pass2" name="newpassword"
  179. placeholder="<?php p($l->t('New password')); ?>"
  180. data-typetoggle="#personal-show"
  181. autocomplete="off" autocapitalize="off" autocorrect="off" />
  182. <input type="checkbox" id="personal-show" name="show" /><label for="personal-show" class="personal-show-label"></label>
  183. <input id="passwordbutton" type="submit" value="<?php p($l->t('Change password')); ?>" />
  184. <br/>
  185. </form>
  186. <?php
  187. }
  188. ?>
  189. <form id="language" class="section">
  190. <h2>
  191. <label for="languageinput"><?php p($l->t('Language'));?></label>
  192. </h2>
  193. <select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
  194. <option value="<?php p($_['activelanguage']['code']);?>">
  195. <?php p($_['activelanguage']['name']);?>
  196. </option>
  197. <?php foreach($_['commonlanguages'] as $language):?>
  198. <option value="<?php p($language['code']);?>">
  199. <?php p($language['name']);?>
  200. </option>
  201. <?php endforeach;?>
  202. <optgroup label="––––––––––"></optgroup>
  203. <?php foreach($_['languages'] as $language):?>
  204. <option value="<?php p($language['code']);?>">
  205. <?php p($language['name']);?>
  206. </option>
  207. <?php endforeach;?>
  208. </select>
  209. <a href="https://www.transifex.com/nextcloud/nextcloud/"
  210. target="_blank" rel="noreferrer">
  211. <em><?php p($l->t('Help translate'));?></em>
  212. </a>
  213. </form>
  214. <div id="clientsbox" class="section clientsbox">
  215. <h2><?php p($l->t('Get the apps to sync your files'));?></h2>
  216. <a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
  217. <img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
  218. alt="<?php p($l->t('Desktop client'));?>" />
  219. </a>
  220. <a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
  221. <img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
  222. alt="<?php p($l->t('Android app'));?>" />
  223. </a>
  224. <a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
  225. <img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
  226. alt="<?php p($l->t('iOS app'));?>" />
  227. </a>
  228. <p>
  229. <?php print_unescaped(str_replace(
  230. [
  231. '{contributeopen}',
  232. '{linkclose}',
  233. ],
  234. [
  235. '<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer">',
  236. '</a>',
  237. ],
  238. $l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
  239. </p>
  240. <?php if(OC_APP::isEnabled('firstrunwizard')) {?>
  241. <p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
  242. <?php }?>
  243. </div>
  244. <div id="sessions" class="section">
  245. <h2><?php p($l->t('Sessions'));?></h2>
  246. <span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.'));?></span>
  247. <table class="icon-loading">
  248. <thead class="token-list-header">
  249. <tr>
  250. <th><?php p($l->t('Device'));?></th>
  251. <th><?php p($l->t('Last activity'));?></th>
  252. <th></th>
  253. </tr>
  254. </thead>
  255. <tbody class="token-list">
  256. </tbody>
  257. </table>
  258. </div>
  259. <div id="apppasswords" class="section">
  260. <h2><?php p($l->t('App passwords'));?></h2>
  261. <p><?php p($l->t('Passcodes that give an app or device permissions to access your account.'));?></p>
  262. <table class="icon-loading">
  263. <thead class="hidden-when-empty">
  264. <tr>
  265. <th><?php p($l->t('Name'));?></th>
  266. <th><?php p($l->t('Last activity'));?></th>
  267. <th></th>
  268. </tr>
  269. </thead>
  270. <tbody class="token-list">
  271. </tbody>
  272. </table>
  273. <div id="app-password-form">
  274. <input id="app-password-name" type="text" placeholder="<?php p($l->t('App name')); ?>">
  275. <button id="add-app-password" class="button"><?php p($l->t('Create new app password')); ?></button>
  276. </div>
  277. <div id="app-password-result" class="hidden">
  278. <span>
  279. <?php p($l->t('Use the credentials below to configure your app or device.')); ?>
  280. <?php p($l->t('For security reasons this password will only be shown once.')); ?>
  281. </span>
  282. <div class="app-password-row">
  283. <span class="app-password-label"><?php p($l->t('Username')); ?></span>
  284. <input id="new-app-login-name" type="text" readonly="readonly"/>
  285. </div>
  286. <div class="app-password-row">
  287. <span class="app-password-label"><?php p($l->t('Password')); ?></span>
  288. <input id="new-app-password" type="text" readonly="readonly"/>
  289. <a class="clipboardButton icon icon-clippy" data-clipboard-target="#new-app-password"></a>
  290. <button id="app-password-hide" class="button"><?php p($l->t('Done')); ?></button>
  291. </div>
  292. </div>
  293. </div>
  294. <?php foreach($_['forms'] as $form) {
  295. if (isset($form['form'])) {?>
  296. <div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
  297. <?php }
  298. };?>
  299. <div class="section">
  300. <h2><?php p($l->t('Version'));?></h2>
  301. <p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
  302. <p><?php include('settings.development.notice.php'); ?></p>
  303. </div>
  304. </div>