Add translation, update player buffer, update picture size, update home to show last added, update install script
parent
c83d559540
commit
716ad1deca
@ -1,63 +1,64 @@
|
||||
<?php
|
||||
|
||||
use Fuel\Core\Controller_Template;
|
||||
use Fuel\Core\Response;
|
||||
use Fuel\Core\Session;
|
||||
use Fuel\Core\View;
|
||||
|
||||
class Controller_Admin extends Controller_Template
|
||||
{
|
||||
public $template = 'admin/body';
|
||||
|
||||
public function before()
|
||||
{
|
||||
parent::before();
|
||||
$user = Session::get('user');
|
||||
|
||||
if(!$user)
|
||||
Response::redirect('/login');
|
||||
|
||||
if(!$user->admin)
|
||||
Response::redirect('/home');
|
||||
|
||||
Lang::load('menu');
|
||||
Lang::load('action');
|
||||
|
||||
$this->template->user = Session::get('user');
|
||||
|
||||
$this->template->js_bottom = ['plex_alert.js'];
|
||||
}
|
||||
|
||||
public function action_index()
|
||||
{
|
||||
$body = View::forge('admin/index');
|
||||
|
||||
$this->template->body = $body;
|
||||
}
|
||||
|
||||
public function action_servers()
|
||||
{
|
||||
$this->template->js_bottom = ['plex_alert.js', 'server_refresh.js'];
|
||||
|
||||
$body = View::forge('admin/servers');
|
||||
|
||||
$servers = Model_Server::find_all();
|
||||
|
||||
$body->set('servers', $servers);
|
||||
|
||||
$this->template->body = $body;
|
||||
}
|
||||
|
||||
public function action_users()
|
||||
{
|
||||
$this->template->js_bottom = ['plex_alert.js'];
|
||||
|
||||
$body = View::forge('admin/users');
|
||||
|
||||
$users = Model_User::find_all();
|
||||
|
||||
$body->set('users', $users);
|
||||
|
||||
$this->template->body = $body;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
use Fuel\Core\Controller_Template;
|
||||
use Fuel\Core\Lang;
|
||||
use Fuel\Core\Response;
|
||||
use Fuel\Core\Session;
|
||||
use Fuel\Core\View;
|
||||
|
||||
class Controller_Admin extends Controller_Template
|
||||
{
|
||||
public $template = 'admin/body';
|
||||
|
||||
public function before()
|
||||
{
|
||||
parent::before();
|
||||
$user = Session::get('user');
|
||||
|
||||
if(!$user)
|
||||
Response::redirect('/login');
|
||||
|
||||
if(!$user->admin)
|
||||
Response::redirect('/home');
|
||||
|
||||
Lang::load('menu');
|
||||
Lang::load('action');
|
||||
|
||||
$this->template->user = Session::get('user');
|
||||
|
||||
$this->template->js_bottom = ['plex_alert.js'];
|
||||
}
|
||||
|
||||
public function action_index()
|
||||
{
|
||||
$body = View::forge('admin/index');
|
||||
|
||||
$this->template->body = $body;
|
||||
}
|
||||
|
||||
public function action_servers()
|
||||
{
|
||||
$this->template->js_bottom = ['plex_alert.js', 'server_refresh.js'];
|
||||
|
||||
$body = View::forge('admin/servers');
|
||||
|
||||
$servers = Model_Server::find_all();
|
||||
|
||||
$body->set('servers', $servers);
|
||||
|
||||
$this->template->body = $body;
|
||||
}
|
||||
|
||||
public function action_users()
|
||||
{
|
||||
$this->template->js_bottom = ['plex_alert.js'];
|
||||
|
||||
$body = View::forge('admin/users');
|
||||
|
||||
$users = Model_User::find_all();
|
||||
|
||||
$body->set('users', $users);
|
||||
|
||||
$this->template->body = $body;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Fuel\Core\Controller_Rest;
|
||||
use Fuel\Core\Input;
|
||||
use Fuel\Core\Session;
|
||||
use Fuel\Core\View;
|
||||
use Fuel\Core\FuelException;
|
||||
|
||||
class Controller_Rest_Player extends Controller_Rest
|
||||
{
|
||||
public function put_movie()
|
||||
{
|
||||
try {
|
||||
$movie_id = Input::put('movie_id');
|
||||
$watching_time = Input::put('watching_time');
|
||||
$ended_time = Input::put('ended_time');
|
||||
$user = Session::get('user');
|
||||
|
||||
if (!$movie_id)
|
||||
throw new FuelException('No movie id');
|
||||
|
||||
$movie = Model_Movie::find_by_pk($movie_id);
|
||||
|
||||
if (!$movie)
|
||||
throw new FuelException('No movie found');
|
||||
|
||||
$user_watching = Model_User_Watching::find_one_by([
|
||||
['movie_id', '=', $movie_id],
|
||||
['movie_id', '=', $user->id]
|
||||
]) ?: new Model_User_Watching();
|
||||
|
||||
return $this->response(['error' => false, 'message' => 'OK!'], 200);
|
||||
} catch (Exception $exception) {
|
||||
return $this->response($exception->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class Model_Setting extends Model_Overwrite
|
||||
{
|
||||
protected static $_table_name = 'user_setting';
|
||||
protected static $_primary_key = 'id';
|
||||
protected static $_rules = array(
|
||||
'user_id' => 'required',
|
||||
);
|
||||
protected static $_properties = array(
|
||||
'id',
|
||||
'user_id',
|
||||
'language',
|
||||
'trailer_type',
|
||||
'trailer',
|
||||
'subtitle',
|
||||
'maxdownloadspeed',
|
||||
);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
class Model_User_Watching extends Model_Overwrite
|
||||
{
|
||||
protected static $_table_name = 'user_watching';
|
||||
protected static $_primary_key = 'id';
|
||||
protected static $_properties = array(
|
||||
'id',
|
||||
'user_id',
|
||||
'movie_id',
|
||||
'watching_time',
|
||||
'ended_time',
|
||||
'isFinish'
|
||||
);
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<?php return [
|
||||
'RIGHT_WATCH' => 'Allow Watch',
|
||||
'RIGHT_WATCH_DESCRIPTION' => 'Allow use to watch movie/tv show.',
|
||||
'RIGHT_MAX_WATCH' => 'Max Play in 24H',
|
||||
'RIGHT_MAX_WATCH_DESCRIPTION' => 'Maximum number to play movie/tv show in 24H.',
|
||||
'RIGHT_MAX_QUALITY' => 'Stream Quality',
|
||||
'RIGHT_MAX_QUALITY_DESCRIPTION' => 'The maximum quality to play a move/tv show.',
|
||||
'RIGHT_MAX_CONCURRENT_STREAM' => 'Concurrent stream ',
|
||||
'RIGHT_MAX_CONCURRENT_STREAM_DESCRIPTION' => 'Number of concurrent stream allowed.',
|
||||
'RIGHT_DOWNLOAD' => 'Allow Download',
|
||||
'RIGHT_DOWNLOAD_DESCRIPTION' => 'Give the permission at user to download movie/tv show.',
|
||||
'RIGHT_MAX_DOWNLOAD' => 'Max Download',
|
||||
'RIGHT_MAX_DOWNLOAD_DESCRIPTION' => 'The maximum number of download allow to a use in 24H.',
|
||||
];
|
Loading…
Reference in new issue