Ejemplo n.º 1
0
$PAGE->set_heading($strheading);
require_login();
global $DB;
require_once '../lib.php';
echo $OUTPUT->header();
$createdtag = 0;
$tagfound = 0;
$aliasfound = 0;
echo '<div class="manageTable">
<h1>Manual SSO/Bulk Upload Sync</h1>
<a>Manually check for changes from your last SSO sync or Bulk Upload. This will ensure all your users have all the tags correct after you have fixed any missing tags/categories.</a><br><br><br><a href="sync.php?execute=true">Sync Now</a><br><br>';
if (isset($_GET['execute'])) {
    if ($_GET['execute'] == "true") {
        $usertagtime = new \block_hierarchy\trackTime();
        $usertagtime->start();
        $sync = new \block_hierarchy\hierarchysync();
        $sync->sync();
        echo 'Time Taken: ' . $usertagtime->timetaken() . 'secs<br>
        Tags Created: ' . $sync->getTagCreated() . '<br>' . 'Tags Found: ' . $sync->getTagFound() . '<br>' . 'Alias Found: ' . $sync->getAliasFound() . '<br>';
    }
}
echo '</div>';
$error = optional_param('error', '', PARAM_NOTAGS);
if ($error) {
    echo $OUTPUT->notification($error, 'notifyerror');
}
$success = optional_param('success', '', PARAM_NOTAGS);
if ($success) {
    echo $OUTPUT->notification($success, 'notifysuccess');
}
echo $OUTPUT->footer();
 public function execute()
 {
     $sync = new \block_hierarchy\hierarchysync();
     $sync->sync();
 }