/** * 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); }
<img src="<?php echo Render::image('new-user.png'); ?> " alt="avatar" class="img-rounded img-responsive" title="Choose New Account"> </a> </div> <div class="caption pull-left"> <h3>Not done?</h3> <h6>Add as many accounts as you want</h6> <h6>Click the button below to add another one</h6> <br /> <p> <a href="<?php echo Render::link('accounts/add'); ?> " class="btn btn-xs btn-success">Add Account </a> </p> </div> </div> </div> </div> </div> <?php echo Render::view('common/copyright'); ?>
?> <?php } ?> </ul> </div> <?php } else { ?> <div class="alert alert-info text-center alert-dismissable no-common"> You have no services enabled that support cleaning. Please refine your permissions <a href="<?php echo Render::link('accounts/permissions'); ?> ">here</a>. </div> <?php } ?> <?php } else { ?> <div class="alert alert-info text-center alert-dismissable no-common"> You have no services enabled that support cleaning. Please refine your permissions <a href="<?php echo Render::link('accounts/permissions'); ?> ">here</a>. </div> <?php } ?> </div>
} ?> </td> <td> <?php if ($task['status'] > 1) { ?> <?php if ($task['status'] == 2) { ?> <a href="<?php echo Render::link('migrate/revert/' . $task['id']); ?> " class="btn btn-xs btn-default pull-right margin-left-xs margin-bottom-xs">Revert</a> <?php } ?> <a href="<?php echo Render::link('migrate/details/' . $task['id']); ?> " class="btn btn-xs btn-info pull-right margin-left-xs margin-bottom-xs">Details</a> <?php } ?> </td> </tr> <?php } ?> </tbody> </table>
<li><a href="<?php echo Render::link('accounts/details'); ?> ">Profile</a></li> <li><a href="<?php echo Render::link('accounts/permissions'); ?> ">Permissions</a></li> <li><a href="<?php echo Render::link('accounts'); ?> ">Accounts</a></li> <li class="divider"></li> <li><a href="<?php echo Render::link('accounts/add'); ?> ">Add Account</a></li> </ul> </li> <li><a href="<?php echo Render::link('logout'); ?> ">Logout</a></li> </ul> </div><!--/.navbar-collapse --> </div> </div>
</div> <?php if ($profile) { ?> <div id="gSignInWrapper"> <div id="customBtn" class="customGPlusSignIn"> <span class="icon"></span> <span class="buttonText">Save to my Google account</span> </div> </div> <?php } else { ?> <a href="<?php echo @Render::link($_SERVER['HTTP_REFERRER']); ?> " class="btn btn-lg btn-primary" title="Back" style="width: 310px; margin: 0px auto; display: block"> Back </a> <?php } ?> </div> </div> <footer class="clearfix"> <div class="container"> <div class="clearfix centered copyright"> <div class="pull-left">With love from <strong>Timisoara</strong>, Romania</div>
?> ..</a></td> <td><?php echo Util::countup(date('m/d/Y H:i:s', strtotime($task['share']['created_at']) + $task['share']['expires'])); ?> </td> <td> <?php if ($task['status'] > 1) { ?> <a href="<?php echo Render::link('share/remove/' . $task['id']); ?> " class="btn btn-xs btn-danger pull-right margin-left-xs margin-bottom-xs">Delete</a> <a href="<?php echo Render::link('share/details/' . $task['id']); ?> " class="btn btn-xs btn-default pull-right margin-left-xs margin-bottom-xs">Details</a> <a href="#" data-link="<?php echo BASE_URL . 'shared/link/' . $task['share']['link']; ?> " class="copy-to-clipboard btn btn-xs btn-info pull-right margin-left-xs margin-bottom-xs">Copy to Clipboard</a> <?php } ?> </td> </tr> <?php } ?> </tbody>
</div> <!-- Buttons --> <a href="<?php echo Render::link('share'); ?> " class="btn btn-md btn-default" title="Back"> <i class="fa fa-caret-left"></i> Back </a> <?php if ($task['status'] == 2) { ?> <a href="<?php echo Render::link('share/remove/' . $task['id']); ?> " class="btn btn-md btn-primary pull-right" title="Delete"> <i class="fa fa-trash-o"></i> Delete </a> <?php } ?> </div> </div> <div class="container"> <?php if ($task['status'] == \app\models\TasksModel::STATUS_REVERTED) { ?>
<div class="navbar navbar-warning navbar-fixed-top"> <div class="container"> <p class="navbar-text"> Initial Account Setup </p> <a href="<?php echo Render::link($skipUrl); ?> " type="button" class="btn btn-warning navbar-btn pull-right">Skip (<?php echo $step; ?> /2)</a> </div> </div>
</div> <!-- Buttons --> <a href="<?php echo Render::link('migrate'); ?> " class="btn btn-md btn-default" title="Back"> <i class="fa fa-caret-left"></i> Back </a> <?php if ($task['status'] == 2) { ?> <a href="<?php echo Render::link('migrate/revert/' . $task['id']); ?> " class="btn btn-md btn-primary pull-right" title="Revert"> <i class="fa fa-repeat"></i> Revert </a> <?php } ?> </div> </div> <div class="container"> <?php if ($task['status'] == \app\models\TasksModel::STATUS_REVERTED) { ?>
echo '<a href="' . Render::link('migrate/details/' . $task['id']) . '" class="btn btn-xs btn-info pull-right margin-left-xs margin-bottom-xs">Details</a>'; } if (in_array($task['status'], array(\app\models\TasksModel::STATUS_FINISHED))) { echo '<a href="' . Render::link('migrate/revert/' . $task['id']) . '" class="btn btn-xs btn-default pull-right margin-left-xs margin-bottom-xs">Revert</a>'; } break; case \app\models\TasksModel::TYPE_CLEAN: if (in_array($task['status'], array(\app\models\TasksModel::STATUS_FINISHED, \app\models\TasksModel::STATUS_REVERTED))) { echo '<a href="' . Render::link('clean/details/' . $task['id']) . '" class="btn btn-xs btn-info pull-right margin-left-xs margin-bottom-xs">Details</a>'; } if (in_array($task['status'], array(\app\models\TasksModel::STATUS_FINISHED))) { echo '<a href="' . Render::link('clean/revert/' . $task['id']) . '" class="btn btn-xs btn-default pull-right margin-left-xs margin-bottom-xs">Revert</a>'; } break; case \app\models\TasksModel::TYPE_SHARE: if (in_array($task['status'], array(\app\models\TasksModel::STATUS_FINISHED))) { echo '<a href="' . Render::link('share/remove/' . $task['id']) . '" class="btn btn-xs btn-danger pull-right margin-left-xs margin-bottom-xs">Delete</a>'; } if (in_array($task['status'], array(\app\models\TasksModel::STATUS_FINISHED, \app\models\TasksModel::STATUS_REVERTED))) { echo '<a href="' . Render::link('share/details/' . $task['id']) . '" class="btn btn-xs btn-info pull-right margin-left-xs margin-bottom-xs">Details</a>'; } break; } ?> </td> </tr> <?php } ?> </tbody> </table>
?> <br /> <?php } ?> <?php } ?> </td> <td> <a href="<?php echo Render::link('clean/details/' . $task['id']); ?> " class="btn btn-xs btn-info pull-right margin-left-xs margin-bottom-xs">Details</a> <?php if ($task['status'] == \app\models\TasksModel::STATUS_FINISHED) { ?> <a href="<?php echo Render::link('clean/revert/' . $task['id']); ?> " class="btn btn-xs btn-default pull-right margin-left-xs margin-bottom-xs">Revert</a> <?php } ?> </td> </tr> <?php } ?> </tbody> </table>