@@ -5,6 +5,9 @@ |
||
| 5 | 5 | |
| 6 | 6 | trait FileUploadTrait |
| 7 | 7 | { |
| 8 | + /** |
|
| 9 | + * @param string $attribute |
|
| 10 | + */ |
|
| 8 | 11 | public function uploadFile($attribute, $file) |
| 9 | 12 | { |
| 10 | 13 | $existingFile = $this->getAttribute($attribute); |
@@ -29,7 +29,6 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * Update the specified resource in storage. |
| 31 | 31 | * |
| 32 | - * @param int $id |
|
| 33 | 32 | * @return Response |
| 34 | 33 | */ |
| 35 | 34 | public function update(Request $request) |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Display a listing of the Shows. |
| 22 | 22 | * |
| 23 | - * @return Response |
|
| 23 | + * @return \Illuminate\View\View |
|
| 24 | 24 | */ |
| 25 | 25 | public function index() |
| 26 | 26 | { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Display a listing of the resource. |
| 33 | 33 | * |
| 34 | - * @return Response |
|
| 34 | + * @return \Illuminate\View\View |
|
| 35 | 35 | */ |
| 36 | 36 | public function new_show() |
| 37 | 37 | { |
@@ -39,10 +39,10 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * Save the new Show. |
|
| 43 | - * |
|
| 44 | - *@return Response |
|
| 45 | - */ |
|
| 42 | + * Save the new Show. |
|
| 43 | + * |
|
| 44 | + *@return Response |
|
| 45 | + */ |
|
| 46 | 46 | public function create(Requests\CreateRequest $request) |
| 47 | 47 | { |
| 48 | 48 | $show = new Show($request->except(['show_picture', 'slider_picture'])); |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * Update the specified resource in storage. |
| 31 | 31 | * |
| 32 | - * @param int $id |
|
| 33 | - * @return Response |
|
| 32 | + * @return \Illuminate\Http\RedirectResponse |
|
| 34 | 33 | */ |
| 35 | 34 | public function update(Request $request) |
| 36 | 35 | { |
@@ -41,12 +41,12 @@ |
||
| 41 | 41 | $value = $input['value_' . $setting->id]; |
| 42 | 42 | $setting->value = $value; |
| 43 | 43 | |
| 44 | - $enabled_id = 'enabled_' . $setting->id; |
|
| 45 | - if (array_key_exists($enabled_id, $input)) { |
|
| 46 | - $setting->enabled = $input[$enabled_id]; |
|
| 47 | - } else { |
|
| 48 | - $setting->enabled = 1; |
|
| 49 | - } |
|
| 44 | + $enabled_id = 'enabled_' . $setting->id; |
|
| 45 | + if (array_key_exists($enabled_id, $input)) { |
|
| 46 | + $setting->enabled = $input[$enabled_id]; |
|
| 47 | + } else { |
|
| 48 | + $setting->enabled = 1; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | 51 | $setting->save(); |
| 52 | 52 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * Display a listing of the Users. |
| 28 | 28 | * |
| 29 | - * @return Response |
|
| 29 | + * @return \Illuminate\View\View |
|
| 30 | 30 | */ |
| 31 | 31 | public function index() |
| 32 | 32 | { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Show the form for creating a new resource. |
| 45 | 45 | * |
| 46 | - * @return Response |
|
| 46 | + * @return \Illuminate\Http\RedirectResponse|null |
|
| 47 | 47 | */ |
| 48 | 48 | public function create(Requests\CreateRequest $request) |
| 49 | 49 | { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * Show the form for editing the specified resource. |
| 72 | 72 | * |
| 73 | 73 | * @param int $id |
| 74 | - * @return Response |
|
| 74 | + * @return \Illuminate\View\View |
|
| 75 | 75 | */ |
| 76 | 76 | public function edit($id) |
| 77 | 77 | { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * Remove the specified resource from storage. |
| 97 | 97 | * |
| 98 | 98 | * @param int $id |
| 99 | - * @return Response |
|
| 99 | + * @return \Illuminate\Http\RedirectResponse |
|
| 100 | 100 | */ |
| 101 | 101 | public function delete($id) |
| 102 | 102 | { |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $user->password = ''; |
| 53 | 53 | $user->save(); |
| 54 | 54 | |
| 55 | - $response = $this->passwords->sendResetLink($request->only('email'), function($m) |
|
| 55 | + $response = $this->passwords->sendResetLink($request->only('email'), function($m) |
|
| 56 | 56 | { |
| 57 | 57 | $m->subject('Welcome to WITR!'); |
| 58 | 58 | }); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * Display a listing of the Videos. |
| 20 | 20 | * |
| 21 | - * @return Response |
|
| 21 | + * @return \Illuminate\View\View |
|
| 22 | 22 | */ |
| 23 | 23 | public function index() |
| 24 | 24 | { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * Display a listing of the resource. |
| 31 | 31 | * |
| 32 | - * @return Response |
|
| 32 | + * @return \Illuminate\View\View |
|
| 33 | 33 | */ |
| 34 | 34 | public function new_review() |
| 35 | 35 | { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * Save the new eboard position. |
| 41 | 41 | * |
| 42 | - *@return Response |
|
| 42 | + *@return \Illuminate\Http\RedirectResponse |
|
| 43 | 43 | */ |
| 44 | 44 | public function create(Requests\CreateRequest $request) |
| 45 | 45 | { |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * Save the new eboard position. |
|
| 41 | - * |
|
| 42 | - *@return Response |
|
| 43 | - */ |
|
| 40 | + * Save the new eboard position. |
|
| 41 | + * |
|
| 42 | + *@return Response |
|
| 43 | + */ |
|
| 44 | 44 | public function create(Requests\CreateRequest $request) |
| 45 | 45 | { |
| 46 | 46 | $input = $request->all(); |
@@ -18,7 +18,6 @@ discard block |
||
| 18 | 18 | * Create a new authentication controller instance. |
| 19 | 19 | * |
| 20 | 20 | * @param \Illuminate\Contracts\Auth\Guard $auth |
| 21 | - * @param \Illuminate\Contracts\Auth\Registrar $registrar |
|
| 22 | 21 | * @return void |
| 23 | 22 | */ |
| 24 | 23 | public function __construct(Guard $auth) |
@@ -31,7 +30,7 @@ discard block |
||
| 31 | 30 | /** |
| 32 | 31 | * Show the application login form. |
| 33 | 32 | * |
| 34 | - * @return \Illuminate\Http\Response |
|
| 33 | + * @return \Illuminate\View\View |
|
| 35 | 34 | */ |
| 36 | 35 | public function login() |
| 37 | 36 | { |
@@ -42,7 +41,7 @@ discard block |
||
| 42 | 41 | * Handle a login request to the application. |
| 43 | 42 | * |
| 44 | 43 | * @param \Illuminate\Http\Request $request |
| 45 | - * @return \Illuminate\Http\Response |
|
| 44 | + * @return \Illuminate\Http\RedirectResponse |
|
| 46 | 45 | */ |
| 47 | 46 | public function authenticate(Request $request) |
| 48 | 47 | { |
@@ -67,7 +66,7 @@ discard block |
||
| 67 | 66 | /** |
| 68 | 67 | * Log the user out of the application. |
| 69 | 68 | * |
| 70 | - * @return \Illuminate\Http\Response |
|
| 69 | + * @return \Illuminate\Http\RedirectResponse |
|
| 71 | 70 | */ |
| 72 | 71 | public function logout() |
| 73 | 72 | { |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * Show the application welcome screen to the user. |
| 28 | 28 | * |
| 29 | - * @return Response |
|
| 29 | + * @return \Illuminate\View\View |
|
| 30 | 30 | */ |
| 31 | 31 | public function index() |
| 32 | 32 | { |
@@ -25,6 +25,9 @@ |
||
| 25 | 25 | return $this->mounts; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | + /** |
|
| 29 | + * @param string $studio |
|
| 30 | + */ |
|
| 28 | 31 | public function get($studio) |
| 29 | 32 | { |
| 30 | 33 | $results = new Collection; |
@@ -9,46 +9,46 @@ |
||
| 9 | 9 | class IcecastReader |
| 10 | 10 | { |
| 11 | 11 | |
| 12 | - protected $hostname; |
|
| 13 | - protected $credentials; |
|
| 14 | - protected $mounts; |
|
| 15 | - |
|
| 16 | - public function __construct($hostname, $credentials, $mounts) |
|
| 17 | - { |
|
| 18 | - $this->hostname = $hostname; |
|
| 19 | - $this->credentials = $credentials; |
|
| 20 | - $this->mounts = $mounts; |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public function getMounts() |
|
| 24 | - { |
|
| 25 | - return $this->mounts; |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function get($studio) |
|
| 29 | - { |
|
| 30 | - $results = new Collection; |
|
| 31 | - |
|
| 32 | - $client = new Client(); |
|
| 12 | + protected $hostname; |
|
| 13 | + protected $credentials; |
|
| 14 | + protected $mounts; |
|
| 15 | + |
|
| 16 | + public function __construct($hostname, $credentials, $mounts) |
|
| 17 | + { |
|
| 18 | + $this->hostname = $hostname; |
|
| 19 | + $this->credentials = $credentials; |
|
| 20 | + $this->mounts = $mounts; |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public function getMounts() |
|
| 24 | + { |
|
| 25 | + return $this->mounts; |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + public function get($studio) |
|
| 29 | + { |
|
| 30 | + $results = new Collection; |
|
| 31 | + |
|
| 32 | + $client = new Client(); |
|
| 33 | 33 | |
| 34 | - $listeners = IcecastListeners::forMounts($this->mounts[$studio]); |
|
| 35 | - foreach ($this->mounts[$studio] as $mount) |
|
| 36 | - { |
|
| 37 | - $response = $client->get($this->hostname . '/admin/listclients?mount=/'. $mount, [ |
|
| 38 | - 'auth' => $this->credentials |
|
| 39 | - ]); |
|
| 40 | - $xml = simplexml_load_string($response->getBody())->source->listener; |
|
| 41 | - foreach ($xml as $node) |
|
| 42 | - { |
|
| 43 | - $listener = new stdClass; |
|
| 44 | - $listener->hostname = gethostbyaddr($node->IP); |
|
| 45 | - $listener->minutesConnected = round($node->Connected / 60); |
|
| 46 | - $listener->userAgent = $node->UserAgent; |
|
| 47 | - $listener->mount = $mount; |
|
| 48 | - $listeners->push($listener); |
|
| 49 | - } |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - return $listeners; |
|
| 53 | - } |
|
| 34 | + $listeners = IcecastListeners::forMounts($this->mounts[$studio]); |
|
| 35 | + foreach ($this->mounts[$studio] as $mount) |
|
| 36 | + { |
|
| 37 | + $response = $client->get($this->hostname . '/admin/listclients?mount=/'. $mount, [ |
|
| 38 | + 'auth' => $this->credentials |
|
| 39 | + ]); |
|
| 40 | + $xml = simplexml_load_string($response->getBody())->source->listener; |
|
| 41 | + foreach ($xml as $node) |
|
| 42 | + { |
|
| 43 | + $listener = new stdClass; |
|
| 44 | + $listener->hostname = gethostbyaddr($node->IP); |
|
| 45 | + $listener->minutesConnected = round($node->Connected / 60); |
|
| 46 | + $listener->userAgent = $node->UserAgent; |
|
| 47 | + $listener->mount = $mount; |
|
| 48 | + $listeners->push($listener); |
|
| 49 | + } |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + return $listeners; |
|
| 53 | + } |
|
| 54 | 54 | } |