/** * Dashboard index page */ public static function index($finish = false) { if ($finish) { \Auth::showWizard('finish'); } else { if (\Auth::showWizard()) { \Router::redirect('accounts/permissions'); } } $templateData = array('template' => 'dashboard/content', 'title' => 'Migrate - Dashboard', 'bodyId' => 'dashboard', 'styles' => array('dashboard.css'), 'scripts' => array(), 'queue' => TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'user_affected_id' => $_SESSION['current']['username']['id']), 4), 'services' => ServicesModel::forUser(array('id' => $_SESSION['current']['username']['id'], 'limit' => 4)), 'usernames' => $_SESSION['usernames'], 'intro' => (bool) IntroModel::first(array('page' => 'dashboard', 'group' => $_SESSION['current']['username']['group']))); if (!$templateData['intro']) { IntroModel::create(array('page' => 'dashboard', 'group' => $_SESSION['current']['username']['group']))->save(); } \Render::layout('template', $templateData); }
/** * Listing accounts */ public static function index($source = -1, $destination = -1) { \Auth::showWizard('finish'); // Wizard Init if (!isset($_SESSION['wizard'])) { $_SESSION['wizard']['action'] = 0; $_SESSION['wizard']['services'] = array(); } static::_setUsers($source, $destination); $source = static::_getUser('source'); $destination = static::_getUser('destination'); $_SESSION['wizard']['commonServices'] = isset($source['services']) && isset($destination['services']) ? @array_intersect_assoc($source['services'], $destination['services']) : array(); $templateData = array('template' => 'migrate/content', 'title' => 'Migrate - Migrate', 'bodyId' => 'migrate', 'styles' => array('common/wizard.css', 'migrate/migrate.css'), 'scripts' => array('common/wizard.js', 'migrate/migrate.js'), 'source' => $source, 'destination' => $destination, 'services' => $_SESSION['wizard']['commonServices'], 'polling' => TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'user_affected_id' => $_SESSION['current']['username']['id'], 'type' => array(TasksModel::TYPE_SYNC, TasksModel::TYPE_MIGRATE, TasksModel::TYPE_MOVE), 'status' => array(TasksModel::STATUS_SCHEDULED, TasksModel::STATUS_PROGRESS, TasksModel::STATUS_REVERTING))) ? 'yes' : 'no', 'tasks' => TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'user_affected_id' => $_SESSION['current']['username']['id'], 'type' => array(TasksModel::TYPE_SYNC, TasksModel::TYPE_MIGRATE, TasksModel::TYPE_MOVE))), 'disabled' => count($_SESSION['usernames']) > 1 ? '' : 'disabled', 'intro' => (bool) IntroModel::first(array('page' => 'migrate', 'group' => $_SESSION['current']['username']['group']))); if (!$templateData['intro']) { IntroModel::create(array('page' => 'migrate', 'group' => $_SESSION['current']['username']['group']))->save(); } if ($templateData['disabled']) { \Util::notice(array('type' => 'warning', 'text' => 'This operation requires at least two accounts. Click <a href="' . \Render::link('accounts/add') . '">here</a> to add another account.', 'persistent' => true)); } \Render::layout('template', $templateData); }
/** * Listing accounts */ public static function index($selectedService = 0) { \Auth::showWizard('finish'); $templateData = array('template' => 'backup/content', 'title' => 'Migrate - Backup', 'bodyId' => 'backup', 'styles' => array('backup.css'), 'scripts' => array('common/wizard.js', 'backup.js'), 'services' => $_SESSION['current']['services']); \Render::layout('template', $templateData); }