personal.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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 print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
  28. array($_['usage'], $_['total_space'])));?>
  29. </p>
  30. </div>
  31. </div>
  32. <div id="personal-settings">
  33. <div id="personal-settings-avatar-container">
  34. <form id="avatarform" class="section" method="post" action="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.postAvatar')); ?>">
  35. <h2>
  36. <label><?php p($l->t('Profile picture')); ?></label>
  37. <span class="icon-password"/>
  38. </h2>
  39. <div id="displayavatar">
  40. <div class="avatardiv"></div>
  41. <div class="warning hidden"></div>
  42. <?php if ($_['avatarChangeSupported']): ?>
  43. <label for="uploadavatar" class="inlineblock button icon-upload svg" id="uploadavatarbutton" title="<?php p($l->t('Upload new')); ?>"></label>
  44. <div class="inlineblock button icon-folder svg" id="selectavatar" title="<?php p($l->t('Select from Files')); ?>"></div>
  45. <div class="hidden button icon-delete svg" id="removeavatar" title="<?php p($l->t('Remove image')); ?>"></div>
  46. <input type="file" name="files[]" id="uploadavatar" class="hiddenuploadfield">
  47. <p><em><?php p($l->t('png or jpg, max. 20 MB')); ?></em></p>
  48. <?php else: ?>
  49. <?php p($l->t('Picture provided by original account')); ?>
  50. <?php endif; ?>
  51. </div>
  52. <div id="cropper" class="hidden">
  53. <div class="inner-container">
  54. <div class="inlineblock button" id="abortcropperbutton"><?php p($l->t('Cancel')); ?></div>
  55. <div class="inlineblock button primary" id="sendcropperbutton"><?php p($l->t('Choose as profile picture')); ?></div>
  56. </div>
  57. </div>
  58. <span class="icon-checkmark hidden"/>
  59. <input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
  60. </form>
  61. </div>
  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 reset 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. <div class="personal-show-container">
  178. <label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
  179. <input type="password" id="pass2" name="newpassword"
  180. placeholder="<?php p($l->t('New password')); ?>"
  181. data-typetoggle="#personal-show"
  182. autocomplete="off" autocapitalize="off" autocorrect="off" />
  183. <input type="checkbox" id="personal-show" name="show" /><label for="personal-show" class="personal-show-label"></label>
  184. </div>
  185. <input id="passwordbutton" type="submit" value="<?php p($l->t('Change password')); ?>" />
  186. <br/>
  187. </form>
  188. <?php
  189. }
  190. ?>
  191. <form id="language" class="section">
  192. <h2>
  193. <label for="languageinput"><?php p($l->t('Language'));?></label>
  194. </h2>
  195. <select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
  196. <option value="<?php p($_['activelanguage']['code']);?>">
  197. <?php p($_['activelanguage']['name']);?>
  198. </option>
  199. <?php foreach($_['commonlanguages'] as $language):?>
  200. <option value="<?php p($language['code']);?>">
  201. <?php p($language['name']);?>
  202. </option>
  203. <?php endforeach;?>
  204. <optgroup label="––––––––––"></optgroup>
  205. <?php foreach($_['languages'] as $language):?>
  206. <option value="<?php p($language['code']);?>">
  207. <?php p($language['name']);?>
  208. </option>
  209. <?php endforeach;?>
  210. </select>
  211. <a href="https://www.transifex.com/nextcloud/nextcloud/"
  212. target="_blank" rel="noreferrer">
  213. <em><?php p($l->t('Help translate'));?></em>
  214. </a>
  215. </form>
  216. <div id="clientsbox" class="section clientsbox">
  217. <h2><?php p($l->t('Get the apps to sync your files'));?></h2>
  218. <a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
  219. <img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
  220. alt="<?php p($l->t('Desktop client'));?>" />
  221. </a>
  222. <a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
  223. <img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
  224. alt="<?php p($l->t('Android app'));?>" />
  225. </a>
  226. <a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
  227. <img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
  228. alt="<?php p($l->t('iOS app'));?>" />
  229. </a>
  230. <p>
  231. <?php print_unescaped(str_replace(
  232. [
  233. '{contributeopen}',
  234. '{linkclose}',
  235. ],
  236. [
  237. '<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer">',
  238. '</a>',
  239. ],
  240. $l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
  241. </p>
  242. <?php if(OC_APP::isEnabled('firstrunwizard')) {?>
  243. <p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
  244. <?php }?>
  245. </div>
  246. <div id="sessions" class="section">
  247. <h2><?php p($l->t('Sessions'));?></h2>
  248. <span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.'));?></span>
  249. <table class="icon-loading">
  250. <thead class="token-list-header">
  251. <tr>
  252. <th><?php p($l->t('Device'));?></th>
  253. <th><?php p($l->t('Last activity'));?></th>
  254. <th></th>
  255. </tr>
  256. </thead>
  257. <tbody class="token-list">
  258. </tbody>
  259. </table>
  260. </div>
  261. <div id="apppasswords" class="section">
  262. <h2><?php p($l->t('App passwords'));?></h2>
  263. <p><?php p($l->t('Passcodes that give an app or device permissions to access your account.'));?></p>
  264. <table class="icon-loading">
  265. <thead class="hidden-when-empty">
  266. <tr>
  267. <th><?php p($l->t('Name'));?></th>
  268. <th><?php p($l->t('Last activity'));?></th>
  269. <th></th>
  270. </tr>
  271. </thead>
  272. <tbody class="token-list">
  273. </tbody>
  274. </table>
  275. <div id="app-password-form">
  276. <input id="app-password-name" type="text" placeholder="<?php p($l->t('App name')); ?>">
  277. <button id="add-app-password" class="button"><?php p($l->t('Create new app password')); ?></button>
  278. </div>
  279. <div id="app-password-result" class="hidden">
  280. <span>
  281. <?php p($l->t('Use the credentials below to configure your app or device.')); ?>
  282. <?php p($l->t('For security reasons this password will only be shown once.')); ?>
  283. </span>
  284. <div class="app-password-row">
  285. <span class="app-password-label"><?php p($l->t('Username')); ?></span>
  286. <input id="new-app-login-name" type="text" readonly="readonly"/>
  287. </div>
  288. <div class="app-password-row">
  289. <span class="app-password-label"><?php p($l->t('Password')); ?></span>
  290. <input id="new-app-password" type="text" readonly="readonly"/>
  291. <a class="clipboardButton icon icon-clippy" data-clipboard-target="#new-app-password"></a>
  292. <button id="app-password-hide" class="button"><?php p($l->t('Done')); ?></button>
  293. </div>
  294. </div>
  295. </div>
  296. <?php foreach($_['forms'] as $form) {
  297. if (isset($form['form'])) {?>
  298. <div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
  299. <?php }
  300. };?>
  301. <div class="section">
  302. <h2><?php p($l->t('Version'));?></h2>
  303. <p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
  304. <p><?php include('settings.development.notice.php'); ?></p>
  305. </div>
  306. </div>