<?php // Check if user is admin, redirect to home if not \OCP\User::checkAdminUser(); // Load JavaScript files \OCP\Util::addScript("mozilla_sync", "admin"); \OCP\Util::addScript("mozilla_sync", "show_notification"); // Assign admin template $tmpl = new \OCP\Template('mozilla_sync', 'admin'); $tmpl->assign('mozillaSyncRestrictGroup', \OCA\mozilla_sync\User::getAuthorizedGroup()); $tmpl->assign('mozillaSyncQuota', \OCA\mozilla_sync\User::getQuota()); $tmpl->assign('mozillaSyncAutoCreateUser', \OCA\mozilla_sync\User::isAutoCreateUser()); return $tmpl->fetchPage(); /* vim: set ts=4 sw=4 tw=80 noet : */
if (!\OCA\mozilla_sync\User::checkUserIsAllowed()) { $authorizedGroup = \OCA\mozilla_sync\User::getAuthorizedGroup(); ?> <p><b><span style="color: red"><?php p($l->t('Error! You are not allowed to use Mozilla Sync! You need to be a member of the %s group.', $authorizedGroup)); ?> </span></b></p><br /> <?php } ?> <p> <em> <?php // Verify whether a Sync account was already created $noSync = false; if (\OCA\mozilla_sync\User::isAutoCreateUser()) { // Create account if it does not already exist if (!\OCA\mozilla_sync\User::hasSyncAccount()) { //create account \OCA\mozilla_sync\User::autoCreateUser(); $formatStr = "Y-m-d H:i:s T"; $lastMod = date($formatStr, time()); } else { $lastMod = \OCA\mozilla_sync\Storage::getLastModifiedTime(); } p($l->t("To use Mozilla Sync enter the credentials in to Mozilla Sync client")); } else { // Verify whether a Sync account was already created $noSync = false; if (!\OCA\mozilla_sync\User::hasSyncAccount()) { $noSync = true;