/** * Listing accounts */ public static function link($link = '') { $share = array(); $data = array(); $task = array(); $service = array(); $backups = array(); $profile = array(); $share = SharesModel::first(array('link' => $link)); if ($share) { $share = $share->toArray(); $data = json_decode($share['data'], true); if (strtotime($share['created_at']) + $share['expires'] > time()) { $task = TasksModel::first($share['task_id'])->toArray(); $service = ServicesModel::first($share['service_id'])->toArray(); $profile = UsersModel::profile($task['user_id']); $backups = call_user_func_array(array('app\\libraries\\' . $service['library'], 'shared'), array($task)); } else { \Util::notice(array('type' => 'danger', 'text' => 'The requested link has expired.')); } } else { \Util::notice(array('type' => 'danger', 'text' => 'The requested link does not exist.')); } $templateData = array('template' => 'shared/content', 'title' => 'Migrate - Shared Data', 'bodyId' => 'shared', 'styles' => array('shared.css'), 'scripts' => array('common/request.js', 'shared.js'), 'share' => $share, 'data' => $data, 'task' => $task, 'service' => $service, 'backups' => $backups, 'profile' => $profile); \Render::layout('template', $templateData); }
public static function details($id) { $templateData = array('template' => 'migrate/details', 'title' => 'Migrate - Details', 'bodyId' => 'details', 'styles' => array('common/wizard.css', 'migrate/details.css'), 'scripts' => array('common/wizard.js', 'migrate/details.js'), 'task' => TasksModel::details($id)); $templateData['source'] = $_SESSION['usernames'][$templateData['task']['user_id']]; $templateData['destination'] = $_SESSION['usernames'][$templateData['task']['user_affected_id']]; \Render::layout('template', $templateData); }
/** * Listing accounts */ public static function index() { $templateData = array('template' => 'activity/content', 'title' => 'Migrate - Activity Queue', 'bodyId' => 'tasks', 'styles' => array('activity.css'), 'scripts' => array('activity.js'), 'polling' => TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'user_affected_id' => $_SESSION['current']['username']['id'], 'status' => array(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']))); // Mark as viewed if ($templateData['polling'] == 'no') { TasksModel::markAsRead(array('user_id' => $_SESSION['current']['username']['id'], 'user_affected_id' => $_SESSION['current']['username']['id'])); } \Render::layout('template', $templateData); }
/** * 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); }
public static function permissions() { $templateData = array('template' => 'accounts/permissions', 'title' => 'Migrate - Permissions', 'bodyId' => 'accounts-update', 'styles' => array('accounts.css'), 'scripts' => array('accounts.js'), 'heading' => 'Select your services', 'description' => 'These are the current available services that can be used in our operations. You can select any time which services are we allowed to use. If you roll-over a service name you can see all the permissions and what action can we performe.', 'services' => ServicesModel::withPermissions(), 'servicesSoon' => ServicesModel::all(array('status' => ServicesModel::STATUS_SOON))->toArray(), 'selectedServices' => UsersServicesModel::all(array('user_id' => $_SESSION['current']['username']['id']))->column('service_id'), 'skipUrl' => 'accounts/add', 'step' => 1); \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); }
/** * Login Page */ public static function index() { $templateData = array('template' => 'login/content', 'title' => 'Migrate Google Data', 'bodyId' => 'login', 'styles' => array('login.css'), 'scripts' => array('login.js')); \Render::layout('template', $templateData); }
public static function index() { $templateData = array('template' => 'error/content', 'title' => 'Migrate - Not found', 'bodyId' => '404', 'styles' => array('error.css'), 'scripts' => array()); \Render::layout('template', $templateData); }
/** * Listing accounts */ public static function index($selectedService = 0) { $templateData = array('template' => 'import/content', 'title' => 'Migrate - Import', 'bodyId' => 'import', 'styles' => array('import.css'), 'scripts' => array(), 'history' => TasksModel::listingFor(array('user_id' => $_SESSION['current']['username']['id'], 'type' => TasksModel::TYPE_IMPORT)), 'services' => $_SESSION['current']['services']); \Render::layout('template', $templateData); }