もっと軽い
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class About extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Account extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Admin;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Users extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Channel extends Common {
|
|
@ -1,18 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller, Session;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Engine;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Common extends Engine {
|
||||
class Common {
|
||||
// use AuthTrait;
|
||||
|
||||
public $user = [];
|
||||
private $engine;
|
||||
public $version = '0.1';
|
||||
private $access_token;
|
||||
private $refresh_token;
|
||||
|
||||
|
@ -32,8 +30,6 @@ class Common extends Engine {
|
|||
else {
|
||||
$this->user = Session::get('ptsess');
|
||||
}
|
||||
|
||||
$this->engine = new Engine;
|
||||
}
|
||||
|
||||
public function getLocal () {
|
||||
|
@ -43,7 +39,7 @@ class Common extends Engine {
|
|||
public function getMe ($param) {
|
||||
if (!isset($_COOKIE['access_token']) && isset($_COOKIE['refresh_token'])) {
|
||||
$r = new Request;
|
||||
$login = new \App\Http\Controllers\Peertube\Login;
|
||||
$login = new \App\Http\Controllers\Login;
|
||||
$r->client_id = $param->client_id;
|
||||
$r->client_secret = $param->client_secret;
|
||||
$r->refresh_token = $this->refresh_token;
|
|
@ -1,112 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Engine {
|
||||
public $user = 0;
|
||||
public $version = '0.1';
|
||||
public $err = '';
|
||||
public $warn = '';
|
||||
public $info = '';
|
||||
public $suc = '';
|
||||
public $css = '';
|
||||
|
||||
public function __construct () {
|
||||
$this->err = '';
|
||||
$this->warn = '';
|
||||
$this->info = '';
|
||||
$this->suc = '';
|
||||
|
||||
if (isset($_COOKIE['language'])) app()->setLocale($_COOKIE['language']);
|
||||
$this->id = checkLegit((isset($_COOKIE['kero_token']) ? $_COOKIE['kero_token'] : ''));
|
||||
$this->user = $this->getLoggedUser((isset($_COOKIE['kero_token']) ? $_COOKIE['kero_token'] : ''));
|
||||
|
||||
$this->css = env('CSSENGINE');
|
||||
if ($this->user && $this->user->profile->gender != 0) $this->css .= '_'.($this->user->profile->gender == 1 ? 'm' : 'f');
|
||||
if (env('CSSMINIFY')) $this->css .= '.min';
|
||||
$this->css .= '.css';
|
||||
}
|
||||
|
||||
function getLoggedUser ($kero) {
|
||||
$check = checkLegit($kero);
|
||||
if ($check == 0) return 0;
|
||||
|
||||
// $cols = getGroupColours();
|
||||
$get = $this->getUser($check);
|
||||
|
||||
return $get;
|
||||
}
|
||||
|
||||
public function getUser ($id) {
|
||||
$get = DB::table('users')->where('id', $id)->first();
|
||||
unset($get->password); unset($get->salt); unset($get->remember_token);
|
||||
$get->profile = DB::table('usr_profile')->where('user_id', $get->id)->first();
|
||||
$get->profile->showname = (!empty($get->profile->display_name) && !is_null($get->profile->display_name) ? $get->profile->display_name : $get->username);
|
||||
$perm_id = DB::table('usr_perm_id')->select('perm_id')->where('user_id', $get->id)->first()->perm_id;
|
||||
$get->perm_module = DB::table('usr_perm_module')->where('usr_perm_id', $perm_id)->first();
|
||||
$get->details = DB::table('usr_details')->where('user_id', $get->id)->first();
|
||||
$get->contacts = DB::table('usr_contacts')->where('user_id', $get->id)->first();
|
||||
$ucol = DB::table('usr_perm_module')->select('id', 'name', 'colour_m', 'colour_f', 'colour_u')->get();
|
||||
|
||||
if (!empty($get->profile->name_style)) $get->profile->name_style = $get->profile->name_style;
|
||||
else {
|
||||
foreach ($ucol as $j3) {
|
||||
if ($j3->id == $perm_id) {
|
||||
if ($get->profile->gender == 1) $get->profile->name_style = $j3->colour_m;
|
||||
else if ($get->profile->gender == 2) $get->profile->name_style = $j3->colour_f;
|
||||
else $get->profile->name_style = $j3->colour_u;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($get->profile->gender == 1) $get->profile->gender_name = '男性';
|
||||
else if ($get->profile->gender == 2) $get->profile->gender_name = '女性';
|
||||
else $get->profile->gender_name = '不明';
|
||||
|
||||
$get->perm = $this->getPermissions($get->kero_token);
|
||||
if (empty($get->profile->avatar) || $get->profile->avatar == '') $get->profile->avatar = 'img/noicon.jpg';
|
||||
$get->profile->avatar = '/'.$get->profile->avatar;
|
||||
|
||||
return $get;
|
||||
}
|
||||
|
||||
public function getPermissionGroup($mdl, $id) { return DB::table($mdl.'_permissions')->where('id', $id)->get(); }
|
||||
public function getPermissionUser($mdl, $id) { return DB::table($mdl.'_user_permissions')->where('user_id', $id)->get(); }
|
||||
|
||||
public function getPermissions ($token) {
|
||||
$check = checkLegit($token);
|
||||
$perm = DB::table('usr_perm_id')->select('perm_id')->where('user_id', $check)->first();
|
||||
$perm = json_decode(json_encode($perm), true);
|
||||
|
||||
if ($check != 0) {
|
||||
$grouppermblg = $this->getPermissionGroup('blg', $perm['perm_id']);
|
||||
$userpermblg = $this->getPermissionUser('blg', $check);
|
||||
|
||||
$grouppermusr = $this->getPermissionGroup('usr', $perm['perm_id']);
|
||||
$userpermusr = $this->getPermissionUser('usr', $check);
|
||||
|
||||
$blgarr = array();
|
||||
$usrarr = array();
|
||||
|
||||
if (!empty($userpermblg[0])) $blgarr = (array)$userpermblg[0];
|
||||
else $blgarr = (array)$grouppermblg[0];
|
||||
$blgarr = array_combine(array_map(function($k){ return 'blg_'.$k; }, array_keys($blgarr)), $blgarr);
|
||||
|
||||
if (!empty($userpermusr[0])) $usrarr = (array)$userpermusr[0];
|
||||
else $usrarr = (array)$grouppermusr[0];
|
||||
$usrarr = array_combine(array_map(function($k){ return 'usr_'.$k; }, array_keys($usrarr)), $usrarr);
|
||||
|
||||
return array_merge($blgarr, $usrarr);
|
||||
}
|
||||
else {
|
||||
$grouppermblg = $this->getPermissionGroup('blg', 6);
|
||||
$grouppermusr = $this->getPermissionGroup('usr', 6);
|
||||
|
||||
(array)$grouppermblg[0] = array_combine(array_map(function($k){ return 'blg_'.$k; }, array_keys((array)$grouppermblg[0])), (array)$grouppermblg[0]);
|
||||
(array)$grouppermusr[0] = array_combine(array_map(function($k){ return 'usr_'.$k; }, array_keys((array)$grouppermusr[0])), (array)$grouppermusr[0]);
|
||||
|
||||
return array_merge((array)$grouppermblg[0], (array)$grouppermusr[0]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Home extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Login extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Logout extends Common {
|
|
@ -1,74 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
class MailerController extends Controller {
|
||||
public function __construct() {}
|
||||
|
||||
public function compose ($val, $form=false) {
|
||||
mb_language('japanese');
|
||||
mb_internal_encoding('UTF-8');
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
try {
|
||||
// $mail->SMTPDebug = 2;
|
||||
$mail->isSMTP();
|
||||
$mail->Host = config('mail.mailers.smtp.host');
|
||||
$mail->Port = config('mail.mailers.smtp.port');
|
||||
$mail->SMTPSecure = config('mail.mailers.smtp.encryption');
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->From = config('mail.'.($form ? 'owner' : 'from').'.address');
|
||||
$mail->FromName = mb_encode_mimeheader(config('mail.mailers.smtp.'.($form ? 'fromname' : 'noreplyfrom')), 'JIS');
|
||||
$mail->Username = config('mail.mailers.smtp.'.($form ? 'username' : 'noreplyuser'));
|
||||
$mail->Password = config('mail.mailers.smtp.'.($form ? 'password' : 'noreplypass'));
|
||||
|
||||
$mail->AddAddress(config('mail.'.($form ? 'owner' : 'from').'.address'));
|
||||
if ($form) $mail->addReplyTo(config('mail.owner.address'), config('mail.owner.name'));
|
||||
else $mail->addReplyTo($val['adr']);
|
||||
|
||||
$mail->SMTPOptions = [
|
||||
'ssl' => [
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
'allow_self_signed' => true
|
||||
]
|
||||
];
|
||||
|
||||
if (isset($val['attach'])) {
|
||||
for ($i=0; $i < count($val['attach']); $i++) {
|
||||
$mail->AddAttachment($val['attach'][$i], $val['attachname'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($val['gpg'])) {
|
||||
$mail->AddStringAttachment($val['gpg'], $val['filename']);
|
||||
$mail->AddStringAttachment($val['bunsyo'], $val['adr'].'.gpg');
|
||||
}
|
||||
|
||||
$mail->isHTML(false);
|
||||
|
||||
$mail->Subject = mb_encode_mimeheader('【'.$val['catname'].'】'.$val['kenmei'], 'JIS');
|
||||
if ($form) $mail->Body = mb_convert_encoding($val['bunsyo'], 'UTF-8');
|
||||
else $mail->Body = mb_convert_encoding($val['bunsyo'], 'JIS');
|
||||
|
||||
if (!$mail->send()) {
|
||||
Log::critical('Mailer error: ' . $mail->ErrorInfo);
|
||||
return false;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::critical($e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Myaccount extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Myaccount;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Myaccount;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Abuses extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Myaccount;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Myaccount;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Applications extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Myaccount\Blocklist;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Myaccount\Blocklist;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Accounts extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Myaccount\Blocklist;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Myaccount\Blocklist;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Servers extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Myaccount;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Myaccount;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Notification extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Myaccount;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Myaccount;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Settings extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Mylibrary extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Mylibrary\History;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Mylibrary\History;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Videos extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Mylibrary;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Mylibrary;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Subscriptions extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Mylibrary;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Mylibrary;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Videochannels extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Mylibrary;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Mylibrary;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Videoplaylists extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Mylibrary;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Mylibrary;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Videos extends Common {
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class RssFeedController extends Controller {
|
||||
public function feed () {
|
||||
$select = ['id', 'user_id', 'title', 'slug', 'publish_date', 'message'];
|
||||
$posts = DB::table('blg_content')->select($select)->where('isPost', true)->where('public_status', 0)->orderBy('id', 'desc')->limit(50)->get();
|
||||
|
||||
foreach ($posts as $k => $v) {
|
||||
$userd = DB::table('users')->where('id', $v->user_id)->first();
|
||||
$userd = DB::table('usr_profile')->where('user_id', $v->user_id)->first();
|
||||
$v->user = $userd->display_name;
|
||||
unset($posts[$k]->user_id);
|
||||
}
|
||||
|
||||
return response()->view('rss.feed', ['posts' => $posts])->header('Content-Type', 'application/xml');
|
||||
}
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Signup extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Videos;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Videos;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Local extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Videos;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Videos;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Overview extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Videos;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Videos;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Recentlyadded extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Videos;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Videos;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Subscriptions extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Videos;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Videos;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Trending extends Common {
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube\Videos;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
namespace App\Http\Controllers\Videos;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Upload extends Common {
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Peertube;
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Peertube\Common;
|
||||
use App\Http\Controllers\Common;
|
||||
// use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Watch extends Common {
|
103
app/helpers.php
|
@ -1,46 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
function getPagesInMenu () {
|
||||
$get = DB::table('blg_content')->select('title', 'slug')->where('public_status', 0)->where('isPost', 0)->where('isMenu', 1)->orderBy('sortorder', 'asc')->get();
|
||||
|
||||
$res = array();
|
||||
$key = 0;
|
||||
|
||||
foreach ($get as $i) {
|
||||
array_push($res, ['key' => $key, 'title' => $i->title, 'slug' => $i->slug]);
|
||||
$key++;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function getCss () {
|
||||
$engine = new \App\Http\Controllers\Engine;
|
||||
return $engine->css;
|
||||
}
|
||||
|
||||
function getPerms () {
|
||||
$engine = new \App\Http\Controllers\Engine;
|
||||
return $engine->getPermissions((isset($_COOKIE['kero_token']) ? $_COOKIE['kero_token'] : ''));
|
||||
}
|
||||
|
||||
function getUser () {
|
||||
$engine = new \App\Http\Controllers\Engine;
|
||||
return $engine->user;
|
||||
}
|
||||
|
||||
function getGroupColours () {
|
||||
return DB::table('usr_perm_module')->select('id', 'colour_m', 'colour_f', 'colour_u')->get()->toArray();
|
||||
}
|
||||
|
||||
function checkLegit ($t) {
|
||||
if (!isset($t) || empty($t) || is_null($t)) return 0;
|
||||
$check = DB::table('users')->select('id')->where('kero_token', $t)->first();
|
||||
return $check->id;
|
||||
}
|
||||
|
||||
function ptComeSrc ($v) {
|
||||
$res = new \stdClass();
|
||||
$res->bg = '#';
|
||||
|
@ -133,66 +92,4 @@ function ptAvatar ($v) {
|
|||
return '/img/noicon.jpg';
|
||||
}
|
||||
|
||||
function userDetail ($id, $kero=null) {
|
||||
if ($kero || $id) {
|
||||
$log_username = null;
|
||||
if (!is_null($id)) $log_username = DB::table('users')->select('id', 'username')->where('id', $id)->first();
|
||||
else $log_username = DB::table('users')->select('id', 'username')->where('kero_token', $kero)->first();
|
||||
$perm_id = DB::table('usr_perm_id')->select('perm_id')->where('user_id', $log_username->id)->first()->perm_id;
|
||||
$p3 = DB::table('usr_profile')->select('gender', 'avatar', 'name_style', 'display_name')->where('user_id', $log_username->id)->first();
|
||||
$user_id = $log_username->id;
|
||||
$log_username = $log_username->username;
|
||||
$showname = '';
|
||||
$showcol = '';
|
||||
$ucol = DB::table('usr_perm_module')->select('id', 'colour_m', 'colour_f', 'colour_u')->get();
|
||||
|
||||
if (!empty($p3->display_name)) $showname = $p3->display_name;
|
||||
else $showname = $log_username;
|
||||
|
||||
if (!empty($p3->name_style)) $showcol = $p3->name_style;
|
||||
else {
|
||||
foreach ($ucol as $j3) {
|
||||
if ($j3->id == $perm_id) {
|
||||
if ($p3->gender == 1) $showcol = $j3->colour_m;
|
||||
else if ($p3->gender == 2) $showcol = $j3->colour_f;
|
||||
else $showcol = $j3->colour_u;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$p3->avatar = ($p3->avatar ? '/'.$p3->avatar : '/img/noicon.jpg');
|
||||
return array('user_id' => $user_id, 'showname' => $showname, 'showcol' => $showcol, 'avatar' => $p3->avatar);
|
||||
}
|
||||
|
||||
return new \stdClass();
|
||||
}
|
||||
|
||||
function getCountries () {
|
||||
$flags = DB::table('nhn_country')->orderBy('id', 'asc')->get();
|
||||
$res = array();
|
||||
|
||||
foreach ($flags as $flag) {
|
||||
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
||||
|
||||
$res[] = array(
|
||||
'value' => $flag->nameEng,
|
||||
'label' => $flag->name
|
||||
);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function makeToken () {
|
||||
$c = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$!%&()';
|
||||
$clen = strlen($c);
|
||||
$token = '';
|
||||
|
||||
for ($i = 0; $i < 128; $i++) {
|
||||
$token .= $c[rand(0, $clen - 1)];
|
||||
}
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
変更前 幅: | 高さ: | サイズ: 380 KiB |
変更前 幅: | 高さ: | サイズ: 3.3 MiB |
変更前 幅: | 高さ: | サイズ: 5.0 KiB |
変更前 幅: | 高さ: | サイズ: 528 B |
変更前 幅: | 高さ: | サイズ: 542 B |
変更前 幅: | 高さ: | サイズ: 563 B |
変更前 幅: | 高さ: | サイズ: 564 B |
変更前 幅: | 高さ: | サイズ: 1.4 KiB |
変更前 幅: | 高さ: | サイズ: 547 B |
変更前 幅: | 高さ: | サイズ: 5.2 KiB |
変更前 幅: | 高さ: | サイズ: 4.5 KiB |
変更前 幅: | 高さ: | サイズ: 832 B |
変更前 幅: | 高さ: | サイズ: 1.3 KiB |
変更前 幅: | 高さ: | サイズ: 545 B |
変更前 幅: | 高さ: | サイズ: 536 B |
変更前 幅: | 高さ: | サイズ: 589 B |
変更前 幅: | 高さ: | サイズ: 1.2 KiB |
変更前 幅: | 高さ: | サイズ: 794 B |
変更前 幅: | 高さ: | サイズ: 1.0 KiB |
変更前 幅: | 高さ: | サイズ: 804 B |
変更前 幅: | 高さ: | サイズ: 1.1 KiB |
変更前 幅: | 高さ: | サイズ: 1.2 KiB |
変更前 幅: | 高さ: | サイズ: 1.2 KiB |
変更前 幅: | 高さ: | サイズ: 536 B |
変更前 幅: | 高さ: | サイズ: 7.7 KiB |
変更前 幅: | 高さ: | サイズ: 1.1 KiB |
変更前 幅: | 高さ: | サイズ: 990 B |
変更前 幅: | 高さ: | サイズ: 666 B |
変更前 幅: | 高さ: | サイズ: 1007 B |
変更前 幅: | 高さ: | サイズ: 962 B |
変更前 幅: | 高さ: | サイズ: 1.5 KiB |
変更前 幅: | 高さ: | サイズ: 1.1 KiB |
変更前 幅: | 高さ: | サイズ: 933 B |
変更前 幅: | 高さ: | サイズ: 1.4 KiB |
変更前 幅: | 高さ: | サイズ: 1019 B |
変更前 幅: | 高さ: | サイズ: 1.4 KiB |
変更前 幅: | 高さ: | サイズ: 1.4 KiB |
変更前 幅: | 高さ: | サイズ: 611 B |
変更前 幅: | 高さ: | サイズ: 591 B |
変更前 幅: | 高さ: | サイズ: 806 B |
変更前 幅: | 高さ: | サイズ: 1.5 KiB |
変更前 幅: | 高さ: | サイズ: 466 B |
変更前 幅: | 高さ: | サイズ: 826 B |
変更前 幅: | 高さ: | サイズ: 834 B |
変更前 幅: | 高さ: | サイズ: 907 B |
変更前 幅: | 高さ: | サイズ: 998 B |
変更前 幅: | 高さ: | サイズ: 947 B |
変更前 幅: | 高さ: | サイズ: 859 B |
変更前 幅: | 高さ: | サイズ: 648 B |
変更前 幅: | 高さ: | サイズ: 1.2 KiB |
変更前 幅: | 高さ: | サイズ: 607 B |
変更前 幅: | 高さ: | サイズ: 1.4 KiB |
変更前 幅: | 高さ: | サイズ: 1.3 KiB |
変更前 幅: | 高さ: | サイズ: 829 B |
変更前 幅: | 高さ: | サイズ: 1.3 KiB |
変更前 幅: | 高さ: | サイズ: 583 B |
変更前 幅: | 高さ: | サイズ: 1.6 KiB |
変更前 幅: | 高さ: | サイズ: 1.4 KiB |
変更前 幅: | 高さ: | サイズ: 483 B |
変更前 幅: | 高さ: | サイズ: 740 B |
変更前 幅: | 高さ: | サイズ: 1.7 KiB |
変更前 幅: | 高さ: | サイズ: 1.2 KiB |
変更前 幅: | 高さ: | サイズ: 1.6 KiB |
変更前 幅: | 高さ: | サイズ: 1.0 KiB |