Пример #1
0
<?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 : */
Пример #2
0
&nbsp;&nbsp;&nbsp;
        <?php 
    p($lastMod);
    ?>
    </p>
    <p>
        <?php 
    p($l->t('Size of stored data:'));
    ?>
&nbsp;&nbsp;&nbsp;
        <?php 
    $size = \OCA\mozilla_sync\Storage::getSyncSize();
    if ($size === false) {
        p($l->t('No data stored yet.'));
    } else {
        $quota = \OCA\mozilla_sync\User::getQuota();
        if ($quota === 0) {
            $quotaString = "(unlimited quota)";
        } else {
            $percentage = 100.0 * (double) $size / (double) $quota;
            $quotaString = "(" . number_format($percentage, 1) . "% used of quota " . human_file_size($quota * 1024) . ")";
        }
        p(human_file_size($size * 1024) . " " . $quotaString);
    }
    ?>
    </p>
    <p>
        <?php 
    p($l->t('Number of synced devices:'));
    ?>
&nbsp;&nbsp;&nbsp;