トークンでしょ
このコミットが含まれているのは:
コミット
eeafe40e0b
|
@ -18,8 +18,8 @@ class AuthController extends Controller {
|
||||||
$this->objPermission = new PermissionController();
|
$this->objPermission = new PermissionController();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkSelf(Request $request) { // /api/auth/checkself
|
public function checkSelf(Request $r) { // /api/auth/checkself
|
||||||
$check = $this->checkLegit($request->kero_token);
|
$check = $this->checkLegit($r->kero_token);
|
||||||
|
|
||||||
return array($check);
|
return array($check);
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,8 @@ class AuthController extends Controller {
|
||||||
return $check->id;
|
return $check->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPerms(Request $request) { // /api/auth/getpermissions
|
public function getPerms(Request $r) { // /api/auth/getpermissions
|
||||||
$check = $this->getPermissions($request->kero_token);
|
$check = $this->getPermissions($r->kero_token);
|
||||||
|
|
||||||
return array($check);
|
return array($check);
|
||||||
}
|
}
|
||||||
|
@ -236,17 +236,17 @@ class AuthController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function register(Request $request) {
|
public function register(Request $r) {
|
||||||
$ip = $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||||||
|
|
||||||
// Anti-spam here.
|
// Anti-spam here.
|
||||||
|
|
||||||
if (!empty($request)) {
|
if (!empty($r)) {
|
||||||
// Check username.
|
// Check username.
|
||||||
//// Exists?
|
//// Exists?
|
||||||
$existUser = DB::table('users')
|
$existUser = DB::table('users')
|
||||||
->select('id')
|
->select('id')
|
||||||
->where('username', $request->username)
|
->where('username', $r->username)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if ($existUser != 0) {
|
if ($existUser != 0) {
|
||||||
|
@ -254,18 +254,18 @@ class AuthController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Empty?
|
//// Empty?
|
||||||
if (empty($request->username)) {
|
if (empty($r->username)) {
|
||||||
return array('Username is empty.');
|
return array('Username is empty.');
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Valid?
|
//// Valid?
|
||||||
if (preg_match("/^[a-zA-Z0-9]+$/", $request->username) == 0) {
|
if (preg_match("/^[a-zA-Z0-9]+$/", $r->username) == 0) {
|
||||||
return array('Please use English characters only.');
|
return array('Please use English characters only.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check password.
|
// Check password.
|
||||||
//// Empty?
|
//// Empty?
|
||||||
if (empty($request->password)) {
|
if (empty($r->password)) {
|
||||||
return array('Password is empty.');
|
return array('Password is empty.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ class AuthController extends Controller {
|
||||||
//// Exists?
|
//// Exists?
|
||||||
$existEmail = DB::table('users')
|
$existEmail = DB::table('users')
|
||||||
->select('id')
|
->select('id')
|
||||||
->where('email', $request->email)
|
->where('email', $r->email)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if ($existEmail != 0) {
|
if ($existEmail != 0) {
|
||||||
|
@ -281,17 +281,17 @@ class AuthController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Empty?
|
//// Empty?
|
||||||
if (empty($request->email)) {
|
if (empty($r->email)) {
|
||||||
return array('Email is empty.');
|
return array('Email is empty.');
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Valid?
|
//// Valid?
|
||||||
if (!filter_var($request->email, FILTER_VALIDATE_EMAIL)) {
|
if (!filter_var($r->email, FILTER_VALIDATE_EMAIL)) {
|
||||||
return array('Email is invalid.');
|
return array('Email is invalid.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$salt = dechex(mt_rand(0, 2147483647)) . dechex(mt_rand(0, 2147483647));
|
$salt = dechex(mt_rand(0, 2147483647)) . dechex(mt_rand(0, 2147483647));
|
||||||
$passwd = hash('sha256', $request->password . $salt);
|
$passwd = hash('sha256', $r->password . $salt);
|
||||||
|
|
||||||
for ($round = 0; $round < 65536; $round++) {
|
for ($round = 0; $round < 65536; $round++) {
|
||||||
$passwd = hash('sha256', $passwd . $salt);
|
$passwd = hash('sha256', $passwd . $salt);
|
||||||
|
@ -299,8 +299,8 @@ class AuthController extends Controller {
|
||||||
|
|
||||||
$addUser = DB::table('users')
|
$addUser = DB::table('users')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'username' => $request->username,
|
'username' => $r->username,
|
||||||
'email' => $request->email,
|
'email' => $r->email,
|
||||||
'password' => $passwd,
|
'password' => $passwd,
|
||||||
'salt' => $salt,
|
'salt' => $salt,
|
||||||
'remember_token' => '',
|
'remember_token' => '',
|
||||||
|
@ -336,7 +336,7 @@ class AuthController extends Controller {
|
||||||
DB::table('usr_profile')
|
DB::table('usr_profile')
|
||||||
->insert([
|
->insert([
|
||||||
'user_id' => $addUser,
|
'user_id' => $addUser,
|
||||||
'gender' => ($request->gender ? $request->gender : 0),
|
'gender' => ($r->gender ? $r->gender : 0),
|
||||||
'member_title' => '',
|
'member_title' => '',
|
||||||
'website_address' => '',
|
'website_address' => '',
|
||||||
'website_name' => '',
|
'website_name' => '',
|
||||||
|
@ -353,7 +353,7 @@ class AuthController extends Controller {
|
||||||
'name_style' => '',
|
'name_style' => '',
|
||||||
'display_name' => '',
|
'display_name' => '',
|
||||||
'yt_channel' => '',
|
'yt_channel' => '',
|
||||||
'country' => ($request->country ? $request->country : 'ASEAN'),
|
'country' => ($r->country ? $r->country : 'ASEAN'),
|
||||||
'date_format' => '',
|
'date_format' => '',
|
||||||
'isClock24' => 0,
|
'isClock24' => 0,
|
||||||
'isShowSeconds' => 0,
|
'isShowSeconds' => 0,
|
||||||
|
@ -381,11 +381,11 @@ class AuthController extends Controller {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function login(Request $request) {
|
public function login(Request $r) {
|
||||||
if (!empty($request)) {
|
if (!empty($r)) {
|
||||||
$checkName = DB::table('users')
|
$checkName = DB::table('users')
|
||||||
->select('*')
|
->select('*')
|
||||||
->where('username', $request->username)
|
->where('username', $r->username)
|
||||||
->first(
|
->first(
|
||||||
'id',
|
'id',
|
||||||
'username',
|
'username',
|
||||||
|
@ -395,7 +395,7 @@ class AuthController extends Controller {
|
||||||
);
|
);
|
||||||
|
|
||||||
// $checkName = json_decode(json_encode($checkName), true);
|
// $checkName = json_decode(json_encode($checkName), true);
|
||||||
$checkPass = hash('sha256', $request->password . $checkName->salt);
|
$checkPass = hash('sha256', $r->password . $checkName->salt);
|
||||||
|
|
||||||
for ($round = 0; $round < 65536; $round++) {
|
for ($round = 0; $round < 65536; $round++) {
|
||||||
$checkPass = hash('sha256', $checkPass . $checkName->salt);
|
$checkPass = hash('sha256', $checkPass . $checkName->salt);
|
||||||
|
@ -444,8 +444,8 @@ class AuthController extends Controller {
|
||||||
else return 1;
|
else return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SendReset(Request $request) {
|
public function SendReset(Request $r) {
|
||||||
$exist = $this->CheckEmail($request->email);
|
$exist = $this->CheckEmail($r->email);
|
||||||
|
|
||||||
if ($exist == 0) {
|
if ($exist == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -453,12 +453,12 @@ class AuthController extends Controller {
|
||||||
else {
|
else {
|
||||||
$check = DB::table('usr_resets')
|
$check = DB::table('usr_resets')
|
||||||
->select('token')
|
->select('token')
|
||||||
->where('email', $request->email)
|
->where('email', $r->email)
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
if ($check > 0) {
|
if ($check > 0) {
|
||||||
DB::table('usr_resets')
|
DB::table('usr_resets')
|
||||||
->where('email', $request->email)
|
->where('email', $r->email)
|
||||||
->delete();
|
->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ class AuthController extends Controller {
|
||||||
|
|
||||||
DB::table('usr_resets')
|
DB::table('usr_resets')
|
||||||
->insert([
|
->insert([
|
||||||
'email' => $request->email,
|
'email' => $r->email,
|
||||||
'token' => $token,
|
'token' => $token,
|
||||||
'due_date' => $due
|
'due_date' => $due
|
||||||
]);
|
]);
|
||||||
|
@ -478,7 +478,7 @@ class AuthController extends Controller {
|
||||||
|
|
||||||
$user = DB::table('users')
|
$user = DB::table('users')
|
||||||
->select('username')
|
->select('username')
|
||||||
->where('email', $request->email)
|
->where('email', $r->email)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
$mess = str_replace('{user}', $user->username, $get->message);
|
$mess = str_replace('{user}', $user->username, $get->message);
|
||||||
|
@ -489,13 +489,13 @@ class AuthController extends Controller {
|
||||||
|
|
||||||
$headers = "MIME-Version: 1.0"."\r\n";
|
$headers = "MIME-Version: 1.0"."\r\n";
|
||||||
$headers .= "Content-Type: text/plain; charset=ISO-2022-JP"."\r\n";
|
$headers .= "Content-Type: text/plain; charset=ISO-2022-JP"."\r\n";
|
||||||
$headers .= "To: ".$request->email."\r\n";
|
$headers .= "To: ".$r->email."\r\n";
|
||||||
$headers .= "From: ".mb_convert_encoding($get->sendname,"ISO-2022-JP","AUTO")." <".$get->sender.">"."\r\n";
|
$headers .= "From: ".mb_convert_encoding($get->sendname,"ISO-2022-JP","AUTO")." <".$get->sender.">"."\r\n";
|
||||||
|
|
||||||
mb_language("ja");
|
mb_language("ja");
|
||||||
|
|
||||||
$res = mail(
|
$res = mail(
|
||||||
$request->email,
|
$r->email,
|
||||||
$subj,
|
$subj,
|
||||||
$mess2,
|
$mess2,
|
||||||
$headers,
|
$headers,
|
||||||
|
@ -527,20 +527,20 @@ class AuthController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function PasswordReset(Request $request) {
|
public function PasswordReset(Request $r) {
|
||||||
if (empty($request->password)) {
|
if (empty($r->password)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$salt = dechex(mt_rand(0, 2147483647)) . dechex(mt_rand(0, 2147483647));
|
$salt = dechex(mt_rand(0, 2147483647)) . dechex(mt_rand(0, 2147483647));
|
||||||
$passwd = hash('sha256', $request->password . $salt);
|
$passwd = hash('sha256', $r->password . $salt);
|
||||||
|
|
||||||
for ($round = 0; $round < 65536; $round++) {
|
for ($round = 0; $round < 65536; $round++) {
|
||||||
$passwd = hash('sha256', $passwd . $salt);
|
$passwd = hash('sha256', $passwd . $salt);
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = DB::table('users')
|
$res = DB::table('users')
|
||||||
->where('email', $request->email)
|
->where('email', $r->email)
|
||||||
->update([
|
->update([
|
||||||
'password' => $passwd,
|
'password' => $passwd,
|
||||||
'salt' => $salt
|
'salt' => $salt
|
||||||
|
@ -549,15 +549,15 @@ class AuthController extends Controller {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recover(Request $request) {
|
public function recover(Request $r) {
|
||||||
$user = User::where('email', $request->email)->first();
|
$user = User::where('email', $r->email)->first();
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
$error_message = "Your email address was not found.";
|
$error_message = "Your email address was not found.";
|
||||||
return response()->json(['success' => false, 'error' => ['email'=> $error_message]], 401);
|
return response()->json(['success' => false, 'error' => ['email'=> $error_message]], 401);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Password::sendResetLink($request->only('email'), function (Message $message) {
|
Password::sendResetLink($r->only('email'), function (Message $message) {
|
||||||
$message->subject('Your Password Reset Link');
|
$message->subject('Your Password Reset Link');
|
||||||
});
|
});
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
@ -570,10 +570,10 @@ class AuthController extends Controller {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkAuth(Request $request) {
|
public function checkAuth(Request $r) {
|
||||||
$get = DB::table('users')
|
$get = DB::table('users')
|
||||||
->select('id', 'kero_token')
|
->select('id', 'kero_token')
|
||||||
->where('kero_token', $request->kero_token)
|
->where('kero_token', $r->kero_token)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
$get = json_decode(json_encode($get), true);
|
$get = json_decode(json_encode($get), true);
|
||||||
|
|
|
@ -43,14 +43,14 @@ class BoardController extends Controller {
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkRead($for, $top, $username, $password) {
|
public function checkRead($for, $top, $kero_token) {
|
||||||
$check = $this->objAuth->checkLegit($username, $password);
|
$check = $this->objAuth->checkLegit($kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
$yetToRead = false;
|
$yetToRead = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($username, $password);
|
$valid = $this->objAuth->getPermissions($kero_token);
|
||||||
$yetToRead = false;
|
$yetToRead = false;
|
||||||
|
|
||||||
if ($valid['for_canview']) {
|
if ($valid['for_canview']) {
|
||||||
|
@ -66,14 +66,14 @@ class BoardController extends Controller {
|
||||||
$isRead[] = array('id' => $top);
|
$isRead[] = array('id' => $top);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($isRead as $r) {
|
foreach ($isRead as $read) {
|
||||||
$rid = 0;
|
$rid = 0;
|
||||||
|
|
||||||
if ($for != 0) {
|
if ($for != 0) {
|
||||||
$rid = $r->id;
|
$rid = $read->id;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$rid = $r['id'];
|
$rid = $read['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$get = DB::table('for_read')
|
$get = DB::table('for_read')
|
||||||
|
@ -105,14 +105,14 @@ class BoardController extends Controller {
|
||||||
return $yetToRead;
|
return $yetToRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function markReadAll (Request $request) {
|
public function markReadAll (Request $r) {
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Guests can\'t read';
|
return 'Guests can\'t read';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_canview']) {
|
if ($valid['for_canview']) {
|
||||||
$tid = DB::table('for_threads')
|
$tid = DB::table('for_threads')
|
||||||
|
@ -126,8 +126,8 @@ class BoardController extends Controller {
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
if ($chk) {
|
if ($chk) {
|
||||||
$request->top_id = $t->id;
|
$r->top_id = $t->id;
|
||||||
$this->readTopic($request);
|
$this->readTopic($r);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$getPost = DB::table('for_posts')
|
$getPost = DB::table('for_posts')
|
||||||
|
@ -154,19 +154,19 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function markReadCat (Request $request) {
|
public function markReadCat (Request $r) {
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Guests can\'t read';
|
return 'Guests can\'t read';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_canview']) {
|
if ($valid['for_canview']) {
|
||||||
$fid = DB::table('for_forums')
|
$fid = DB::table('for_forums')
|
||||||
->select('id')
|
->select('id')
|
||||||
->where('cat_id', $request->cat_id)
|
->where('cat_id', $r->cat_id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
foreach ($fid as $f) {
|
foreach ($fid as $f) {
|
||||||
|
@ -182,8 +182,8 @@ class BoardController extends Controller {
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
if ($chk) {
|
if ($chk) {
|
||||||
$request->top_id = $t->id;
|
$r->top_id = $t->id;
|
||||||
$this->readTopic($request);
|
$this->readTopic($r);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$getPost = DB::table('for_posts')
|
$getPost = DB::table('for_posts')
|
||||||
|
@ -211,19 +211,19 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function markRead (Request $request) {
|
public function markRead (Request $r) {
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Guests can\'t read';
|
return 'Guests can\'t read';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_canview']) {
|
if ($valid['for_canview']) {
|
||||||
$tid = DB::table('for_threads')
|
$tid = DB::table('for_threads')
|
||||||
->select('id')
|
->select('id')
|
||||||
->where('for_id', $request->for_id)
|
->where('for_id', $r->for_id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
foreach ($tid as $t) {
|
foreach ($tid as $t) {
|
||||||
|
@ -233,8 +233,8 @@ class BoardController extends Controller {
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
if ($chk) {
|
if ($chk) {
|
||||||
$request->top_id = $t->id;
|
$r->top_id = $t->id;
|
||||||
$this->readTopic($request);
|
$this->readTopic($r);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$getPost = DB::table('for_posts')
|
$getPost = DB::table('for_posts')
|
||||||
|
@ -261,25 +261,25 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function readTopic(Request $request) { // /api/rpc/board/topic/read
|
public function readTopic(Request $r) { // /api/rpc/board/topic/read
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Guests can\'t read';
|
return 'Guests can\'t read';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_canview']) {
|
if ($valid['for_canview']) {
|
||||||
$getRead = DB::table('for_read')
|
$getRead = DB::table('for_read')
|
||||||
->select('view_time')
|
->select('view_time')
|
||||||
->where('user_id', $check)
|
->where('user_id', $check)
|
||||||
->where('top_id', $request->top_id)
|
->where('top_id', $r->top_id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
$getPost = DB::table('for_posts')
|
$getPost = DB::table('for_posts')
|
||||||
->select('post_date')
|
->select('post_date')
|
||||||
->where('top_id', $request->top_id)
|
->where('top_id', $r->top_id)
|
||||||
->orderBy('post_date', 'desc')
|
->orderBy('post_date', 'desc')
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->first();
|
->first();
|
||||||
|
@ -287,7 +287,7 @@ class BoardController extends Controller {
|
||||||
if ($getRead->view_time < $getPost->post_date) {
|
if ($getRead->view_time < $getPost->post_date) {
|
||||||
DB::table('for_read')
|
DB::table('for_read')
|
||||||
->where('user_id', $check)
|
->where('user_id', $check)
|
||||||
->where('top_id', $request->top_id)
|
->where('top_id', $r->top_id)
|
||||||
->update([
|
->update([
|
||||||
'view_time' => $getPost->post_date
|
'view_time' => $getPost->post_date
|
||||||
]);
|
]);
|
||||||
|
@ -303,20 +303,20 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addCategory(Request $request) { // /api/rpc/board/category/add
|
public function addCategory(Request $r) { // /api/rpc/board/category/add
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_catmod'] == 1) {
|
if ($valid['for_catmod'] == 1) {
|
||||||
$add = DB::table('for_category')
|
$add = DB::table('for_category')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'order' => $request->order
|
'order' => $r->order
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $add;
|
return $add;
|
||||||
|
@ -327,37 +327,37 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editCategory(Request $request) { // /api/rpc/board/category/edit
|
public function editCategory(Request $r) { // /api/rpc/board/category/edit
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_catmod'] == 1) {
|
if ($valid['for_catmod'] == 1) {
|
||||||
return DB::table('for_category')
|
return DB::table('for_category')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'id' => $request->id,
|
'id' => $r->id,
|
||||||
'title' => $request->title
|
'title' => $r->title
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteCategory(Request $request) { // /api/rpc/board/category/delete
|
public function deleteCategory(Request $r) { // /api/rpc/board/category/delete
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_catmod'] == 1) {
|
if ($valid['for_catmod'] == 1) {
|
||||||
return DB::table('for_category')->where('id', $request->id)->delete();
|
return DB::table('for_category')->where('id', $r->id)->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -407,30 +407,30 @@ class BoardController extends Controller {
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addForum(Request $request) { // /api/rpc/board/forum/add
|
public function addForum(Request $r) { // /api/rpc/board/forum/add
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_formod'] == 1) {
|
if ($valid['for_formod'] == 1) {
|
||||||
$add = DB::table('for_forums')
|
$add = DB::table('for_forums')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'last_uid' => 0,
|
'last_uid' => 0,
|
||||||
'cat_id' => $request->cat_id,
|
'cat_id' => $r->cat_id,
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'description' => $request->description,
|
'description' => $r->description,
|
||||||
'threads' => 0,
|
'threads' => 0,
|
||||||
'posts' => 0,
|
'posts' => 0,
|
||||||
'last_date' => 0,
|
'last_date' => 0,
|
||||||
'min_power' => 0,
|
'min_power' => 0,
|
||||||
'permission' => 0,
|
'permission' => 0,
|
||||||
'readonly' => $request->ro,
|
'readonly' => $r->ro,
|
||||||
'post_count_freeze' => $request->pcf,
|
'post_count_freeze' => $r->pcf,
|
||||||
'order' => $request->order,
|
'order' => $r->order,
|
||||||
'parent' => 0
|
'parent' => 0
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -442,40 +442,40 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editForum(Request $request) { // /api/rpc/board/forum/edit
|
public function editForum(Request $r) { // /api/rpc/board/forum/edit
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_formod'] == 1) {
|
if ($valid['for_formod'] == 1) {
|
||||||
return DB::table('for_forums')
|
return DB::table('for_forums')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'cat_id' => $request->cat_id,
|
'cat_id' => $r->cat_id,
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'description' => $request->description,
|
'description' => $r->description,
|
||||||
'readonly' => $request->ro,
|
'readonly' => $r->ro,
|
||||||
'post_count_freeze' => $request->pcf
|
'post_count_freeze' => $r->pcf
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteForum(Request $request) { // /api/rpc/board/forum/delete
|
public function deleteForum(Request $r) { // /api/rpc/board/forum/delete
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_formod'] == 1) {
|
if ($valid['for_formod'] == 1) {
|
||||||
return DB::table('for_forums')->where('id', $request->id)->delete();
|
return DB::table('for_forums')->where('id', $r->id)->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,7 @@ class BoardController extends Controller {
|
||||||
return $get;
|
return $get;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPostsofUser($user_id, $from, $to, Request $request) {
|
public function getPostsofUser($user_id, $from, $to, Request $r) {
|
||||||
$getting = array(
|
$getting = array(
|
||||||
'for_posts.id',
|
'for_posts.id',
|
||||||
'top_id',
|
'top_id',
|
||||||
|
@ -752,7 +752,7 @@ class BoardController extends Controller {
|
||||||
'country'
|
'country'
|
||||||
);
|
);
|
||||||
|
|
||||||
// $valid = $this->objAuth->getPermissions($request->username, $request->password);
|
// $valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
return DB::table('for_posts')
|
return DB::table('for_posts')
|
||||||
->join('users', 'for_posts.user_id', '=', 'users.id')
|
->join('users', 'for_posts.user_id', '=', 'users.id')
|
||||||
|
@ -766,7 +766,7 @@ class BoardController extends Controller {
|
||||||
->get($getting);
|
->get($getting);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserPosts($top_id, $from, $to, Request $request) { // /api/rpc/board/post/getuserposts/top/from/to
|
public function getUserPosts($top_id, $from, $to, Request $r) { // /api/rpc/board/post/getuserposts/top/from/to
|
||||||
$getting = array(
|
$getting = array(
|
||||||
'for_posts.id',
|
'for_posts.id',
|
||||||
'top_id',
|
'top_id',
|
||||||
|
@ -793,7 +793,7 @@ class BoardController extends Controller {
|
||||||
'country'
|
'country'
|
||||||
);
|
);
|
||||||
|
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
return DB::table('for_posts')
|
return DB::table('for_posts')
|
||||||
->join('users', 'for_posts.user_id', '=', 'users.id')
|
->join('users', 'for_posts.user_id', '=', 'users.id')
|
||||||
|
@ -807,7 +807,7 @@ class BoardController extends Controller {
|
||||||
->get($getting);
|
->get($getting);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserPost($id, Request $request) { // /api/rpc/board/post/getuserpost/id
|
public function getUserPost($id, Request $r) { // /api/rpc/board/post/getuserpost/id
|
||||||
$getting = array(
|
$getting = array(
|
||||||
'for_posts.id',
|
'for_posts.id',
|
||||||
'top_id',
|
'top_id',
|
||||||
|
@ -834,7 +834,7 @@ class BoardController extends Controller {
|
||||||
'country'
|
'country'
|
||||||
);
|
);
|
||||||
|
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
return DB::table('for_posts')
|
return DB::table('for_posts')
|
||||||
->join('users', 'for_posts.user_id', '=', 'users.id')
|
->join('users', 'for_posts.user_id', '=', 'users.id')
|
||||||
|
@ -846,17 +846,17 @@ class BoardController extends Controller {
|
||||||
->get($getting);
|
->get($getting);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addTopic(Request $request) { // /api/rpc/board/topic/add
|
public function addTopic(Request $r) { // /api/rpc/board/topic/add
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_post'] == 1) {
|
if ($valid['for_post'] == 1) {
|
||||||
$fpc = $this->getPostCountFreeze($request->for_id);
|
$fpc = $this->getPostCountFreeze($r->for_id);
|
||||||
|
|
||||||
if ($fpc === 0) {
|
if ($fpc === 0) {
|
||||||
$next = $this->getNextPostCount($check);
|
$next = $this->getNextPostCount($check);
|
||||||
|
@ -866,8 +866,8 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
$addTopic = DB::table('for_threads')
|
$addTopic = DB::table('for_threads')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'for_id' => $request->for_id,
|
'for_id' => $r->for_id,
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'started_by' => $check,
|
'started_by' => $check,
|
||||||
'replies' => 0,
|
'replies' => 0,
|
||||||
'views' => 0,
|
'views' => 0,
|
||||||
|
@ -885,12 +885,12 @@ class BoardController extends Controller {
|
||||||
'top_id' => $addTopic,
|
'top_id' => $addTopic,
|
||||||
'user_id' => $check,
|
'user_id' => $check,
|
||||||
'post_date' => time(),
|
'post_date' => time(),
|
||||||
'message' => $request->message,
|
'message' => $r->message,
|
||||||
'delete' => 0,
|
'delete' => 0,
|
||||||
'lastedit' => 0,
|
'lastedit' => 0,
|
||||||
'ipaddress' => $request->ipaddress,
|
'ipaddress' => $r->ipaddress,
|
||||||
'delreason' => '',
|
'delreason' => '',
|
||||||
'nolayout' => $request->nolayout,
|
'nolayout' => $r->nolayout,
|
||||||
'postcount' => $next
|
'postcount' => $next
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -902,17 +902,17 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addPost(Request $request) { // /api/rpc/board/post/add
|
public function addPost(Request $r) { // /api/rpc/board/post/add
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_post'] == 1) {
|
if ($valid['for_post'] == 1) {
|
||||||
$fid = $this->getForumIdFromTopic($request->top_id);
|
$fid = $this->getForumIdFromTopic($r->top_id);
|
||||||
$fpc = $this->getPostCountFreeze($fid);
|
$fpc = $this->getPostCountFreeze($fid);
|
||||||
|
|
||||||
if ($fpc === 0) {
|
if ($fpc === 0) {
|
||||||
|
@ -923,19 +923,19 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
$add = DB::table('for_posts')
|
$add = DB::table('for_posts')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'top_id' => $request->top_id,
|
'top_id' => $r->top_id,
|
||||||
'user_id' => $check,
|
'user_id' => $check,
|
||||||
'post_date' => time(),
|
'post_date' => time(),
|
||||||
'message' => $request->message,
|
'message' => $r->message,
|
||||||
'delete' => 0,
|
'delete' => 0,
|
||||||
'lastedit' => 0,
|
'lastedit' => 0,
|
||||||
'ipaddress' => $request->ipaddress,
|
'ipaddress' => $r->ipaddress,
|
||||||
'delreason' => '',
|
'delreason' => '',
|
||||||
'nolayout' => $request->nolayout,
|
'nolayout' => $r->nolayout,
|
||||||
'postcount' => $next
|
'postcount' => $next
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->browseTopicPosts('p', $add, 0, 15, $request);
|
return $this->browseTopicPosts('p', $add, 0, 15, $r);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return 'Permission denied.';
|
return 'Permission denied.';
|
||||||
|
@ -943,56 +943,56 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editPost(Request $request) { // /api/rpc/board/post/edit
|
public function editPost(Request $r) { // /api/rpc/board/post/edit
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_editother'] == 1 || $valid['for_editown'] == 1) { // TODO: differenciate own from other.
|
if ($valid['for_editother'] == 1 || $valid['for_editown'] == 1) { // TODO: differenciate own from other.
|
||||||
return DB::table('for_posts')
|
return DB::table('for_posts')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'lastedit' => time(),
|
'lastedit' => time(),
|
||||||
'message' => $request->message,
|
'message' => $r->message,
|
||||||
'nolayout' => $request->nolayout
|
'nolayout' => $r->nolayout
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePost(Request $request) { // /api/rpc/board/post/delete
|
public function deletePost(Request $r) { // /api/rpc/board/post/delete
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_del'] == 1) {
|
if ($valid['for_del'] == 1) {
|
||||||
$s = db::table('for_posts')
|
$s = db::table('for_posts')
|
||||||
->select('delete')
|
->select('delete')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->first()->delete;
|
->first()->delete;
|
||||||
|
|
||||||
if ($s === 1) {
|
if ($s === 1) {
|
||||||
$request->delreason = '';
|
$r->delreason = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::table('for_posts')
|
DB::table('for_posts')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'delete' => ($s == 0 ? 1 : 0),
|
'delete' => ($s == 0 ? 1 : 0),
|
||||||
'delreason' => $request->delreason
|
'delreason' => $r->delreason
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'delete' => ($s == 0 ? 1 : 0),
|
'delete' => ($s == 0 ? 1 : 0),
|
||||||
'delreason' => $request->delreason
|
'delreason' => $r->delreason
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1001,23 +1001,23 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function lockTopic(Request $request) { // /api/rpc/board/topic/lock
|
public function lockTopic(Request $r) { // /api/rpc/board/topic/lock
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_locky'] == 1) {
|
if ($valid['for_locky'] == 1) {
|
||||||
$s = db::table('for_threads')
|
$s = db::table('for_threads')
|
||||||
->select('lock')
|
->select('lock')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->first()->lock;
|
->first()->lock;
|
||||||
|
|
||||||
DB::table('for_threads')
|
DB::table('for_threads')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'lock' => ($s == 0 ? 1 : 0)
|
'lock' => ($s == 0 ? 1 : 0)
|
||||||
]);
|
]);
|
||||||
|
@ -1030,18 +1030,18 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unlockTopic(Request $request) { // /api/rpc/board/topic/unlock
|
public function unlockTopic(Request $r) { // /api/rpc/board/topic/unlock
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_locky'] == 1) {
|
if ($valid['for_locky'] == 1) {
|
||||||
return DB::table('for_threads')
|
return DB::table('for_threads')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'lock' => 0
|
'lock' => 0
|
||||||
]);
|
]);
|
||||||
|
@ -1052,25 +1052,25 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function moveTopic(Request $request) { // /api/rpc/board/topic/move
|
public function moveTopic(Request $r) { // /api/rpc/board/topic/move
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_move'] == 1) {
|
if ($valid['for_move'] == 1) {
|
||||||
$res = DB::table('for_threads')
|
$res = DB::table('for_threads')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'for_id' => $request->new_id
|
'for_id' => $r->new_id
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$for = DB::table('for_forums')
|
$for = DB::table('for_forums')
|
||||||
->select('title', 'cat_id')
|
->select('title', 'cat_id')
|
||||||
->where('id', $request->new_id)
|
->where('id', $r->new_id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
$cat = DB::table('for_category')
|
$cat = DB::table('for_category')
|
||||||
|
@ -1079,7 +1079,7 @@ class BoardController extends Controller {
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
return array([
|
return array([
|
||||||
'fid' => $request->new_id,
|
'fid' => $r->new_id,
|
||||||
'ftit' => $for->title,
|
'ftit' => $for->title,
|
||||||
'cid' => $for->cat_id,
|
'cid' => $for->cat_id,
|
||||||
'ctit' => $cat->title
|
'ctit' => $cat->title
|
||||||
|
@ -1091,38 +1091,38 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function splitPost(Request $request) { // /api/rpc/board/post/split
|
public function splitPost(Request $r) { // /api/rpc/board/post/split
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_split'] == 1) {
|
if ($valid['for_split'] == 1) {
|
||||||
$uid = DB::table('for_posts')
|
$uid = DB::table('for_posts')
|
||||||
->select('user_id')
|
->select('user_id')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
$add = DB::table('for_threads')
|
$add = DB::table('for_threads')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'for_id' => $request->forId,
|
'for_id' => $r->forId,
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'started_by' => $uid->user_id,
|
'started_by' => $uid->user_id,
|
||||||
'replies' => 0,
|
'replies' => 0,
|
||||||
'views' => 0,
|
'views' => 0,
|
||||||
'last_date' => 0,
|
'last_date' => 0,
|
||||||
'last_uid' => 0,
|
'last_uid' => 0,
|
||||||
'sticky' => $request->sticky,
|
'sticky' => $r->sticky,
|
||||||
'poll' => 0,
|
'poll' => 0,
|
||||||
'read' => '',
|
'read' => '',
|
||||||
'lock' => $request->lock
|
'lock' => $r->lock
|
||||||
]);
|
]);
|
||||||
|
|
||||||
DB::table('for_posts')
|
DB::table('for_posts')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'top_id' => $add,
|
'top_id' => $add,
|
||||||
]);
|
]);
|
||||||
|
@ -1135,24 +1135,24 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mergeTopic(Request $request) { // /api/rpc/board/topic/merge
|
public function mergeTopic(Request $r) { // /api/rpc/board/topic/merge
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_mergepost'] == 1) {
|
if ($valid['for_mergepost'] == 1) {
|
||||||
DB::table('for_posts')
|
DB::table('for_posts')
|
||||||
->where('top_id', $request->id)
|
->where('top_id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'top_id' => $request->alt_id
|
'top_id' => $r->alt_id
|
||||||
]);
|
]);
|
||||||
|
|
||||||
DB::table('for_threads')
|
DB::table('for_threads')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->delete();
|
->delete();
|
||||||
|
|
||||||
return 'Success!';
|
return 'Success!';
|
||||||
|
@ -1163,23 +1163,23 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pinTopic(Request $request) { // /api/rpc/board/topic/pin
|
public function pinTopic(Request $r) { // /api/rpc/board/topic/pin
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_sticky'] == 1) {
|
if ($valid['for_sticky'] == 1) {
|
||||||
$s = DB::table('for_threads')
|
$s = DB::table('for_threads')
|
||||||
->select('sticky')
|
->select('sticky')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
DB::table('for_threads')
|
DB::table('for_threads')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'sticky' => ($s->sticky == 0 ? 1 : 0)
|
'sticky' => ($s->sticky == 0 ? 1 : 0)
|
||||||
]);
|
]);
|
||||||
|
@ -1192,18 +1192,18 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unpinTopic(Request $request) { // /api/rpc/board/topic/unpin
|
public function unpinTopic(Request $r) { // /api/rpc/board/topic/unpin
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_sticky'] == 1) {
|
if ($valid['for_sticky'] == 1) {
|
||||||
return DB::table('for_threads')
|
return DB::table('for_threads')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'sticky' => 0
|
'sticky' => 0
|
||||||
]);
|
]);
|
||||||
|
@ -1211,14 +1211,14 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getReadCategories (Request $request) { // /api/rpc/board/topic/getreadcategories
|
public function getReadCategories (Request $r) { // /api/rpc/board/topic/getreadcategories
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getReadForums (Request $request) { // /api/rpc/board/topic/getreadforums
|
public function getReadForums (Request $r) { // /api/rpc/board/topic/getreadforums
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getReadTopics (Request $request) { // /api/rpc/board/topic/getreadtopics
|
public function getReadTopics (Request $r) { // /api/rpc/board/topic/getreadtopics
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
|
@ -1247,24 +1247,24 @@ class BoardController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function markForumRead ($id, Request $request) { // /api/rpc/board/topic/markforumread/fid
|
public function markForumRead ($id, Request $r) { // /api/rpc/board/topic/markforumread/fid
|
||||||
}
|
}
|
||||||
|
|
||||||
public function markTopicRead ($id, Request $request) { // /api/rpc/board/topic/marktopicread/tid
|
public function markTopicRead ($id, Request $r) { // /api/rpc/board/topic/marktopicread/tid
|
||||||
}
|
}
|
||||||
|
|
||||||
public function undeletePost(Request $request) { // /api/rpc/board/post/undelete
|
public function undeletePost(Request $r) { // /api/rpc/board/post/undelete
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['for_del'] == 1) {
|
if ($valid['for_del'] == 1) {
|
||||||
return DB::table('for_posts')
|
return DB::table('for_posts')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'delete' => 0,
|
'delete' => 0,
|
||||||
'delreason' => ''
|
'delreason' => ''
|
||||||
|
@ -1283,7 +1283,7 @@ class BoardController extends Controller {
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function browseCategories(Request $request) { // /api/rpc/board/browse/browsecategories
|
public function browseCategories(Request $r) { // /api/rpc/board/browse/browsecategories
|
||||||
$cats = $this->getCategories()->toArray();
|
$cats = $this->getCategories()->toArray();
|
||||||
$cols = $this->objUser->getGroupColours()->toArray();
|
$cols = $this->objUser->getGroupColours()->toArray();
|
||||||
|
|
||||||
|
@ -1297,13 +1297,13 @@ class BoardController extends Controller {
|
||||||
$resF = array();
|
$resF = array();
|
||||||
|
|
||||||
foreach($fors as $f) {
|
foreach($fors as $f) {
|
||||||
$read = $this->checkRead($f['id'], 0, $request->username, $request->password);
|
$read = $this->checkRead($f['id'], 0, $r->kero_token);
|
||||||
$ldet = $this->getLastPostOfForum($f['id']);
|
$ldet = $this->getLastPostOfForum($f['id']);
|
||||||
$topicsuu = DB::table('for_threads')->where('for_id', $f['id'])->count();
|
$topicsuu = DB::table('for_threads')->where('for_id', $f['id'])->count();
|
||||||
$replysuu = $this->countPostsInForum($f['id']);
|
$replysuu = $this->countPostsInForum($f['id']);
|
||||||
|
|
||||||
if ($ldet['uid'] != 0) {
|
if ($ldet['uid'] != 0) {
|
||||||
$user = $this->objUser->getUser($ldet['uid'], $request)->toArray();
|
$user = $this->objUser->getUser($ldet['uid'], $r)->toArray();
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
|
||||||
|
@ -1362,20 +1362,20 @@ class BoardController extends Controller {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function browseForums($id, $from, $to, Request $request) { // /api/rpc/board/browse/browseforums/id/from/to
|
public function browseForums($id, $from, $to, Request $r) { // /api/rpc/board/browse/browseforums/id/from/to
|
||||||
$fors = $this->getForums($id);
|
$fors = $this->getForums($id);
|
||||||
$cols = $this->objUser->getGroupColours()->toArray();
|
$cols = $this->objUser->getGroupColours()->toArray();
|
||||||
|
|
||||||
$res = array();
|
$res = array();
|
||||||
|
|
||||||
foreach($fors as $f) {
|
foreach($fors as $f) {
|
||||||
$read = $this->checkRead($f['id'], 0, $request->username, $request->password);
|
$read = $this->checkRead($f['id'], 0, $r->kero_token);
|
||||||
$ldet = $this->getLastPostOfForum($f['id']);
|
$ldet = $this->getLastPostOfForum($f['id']);
|
||||||
$topicsuu = DB::table('for_threads')->where('for_id', $f['id'])->count();
|
$topicsuu = DB::table('for_threads')->where('for_id', $f['id'])->count();
|
||||||
$replysuu = $this->countPostsInForum($f['id']);
|
$replysuu = $this->countPostsInForum($f['id']);
|
||||||
|
|
||||||
if ($f['last_uid'] != 0) {
|
if ($f['last_uid'] != 0) {
|
||||||
$user = $this->objUser->getUser($ldet['uid'], $request)->toArray();
|
$user = $this->objUser->getUser($ldet['uid'], $r)->toArray();
|
||||||
|
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
@ -1437,7 +1437,7 @@ class BoardController extends Controller {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function browseTopics($mode, $id, $from, $to, Request $request) { // /api/rpc/board/browse/browsetopicsmode/id/from/to
|
public function browseTopics($mode, $id, $from, $to, Request $r) { // /api/rpc/board/browse/browsetopicsmode/id/from/to
|
||||||
$topsUP = $this->getTopicsUnpinned($id, $from, $to);
|
$topsUP = $this->getTopicsUnpinned($id, $from, $to);
|
||||||
$topsPN = $this->getTopicsPinned($id, $from, $to);
|
$topsPN = $this->getTopicsPinned($id, $from, $to);
|
||||||
$topsUS = $this->getTopicsUser($id, $from, $to);
|
$topsUS = $this->getTopicsUser($id, $from, $to);
|
||||||
|
@ -1464,14 +1464,14 @@ class BoardController extends Controller {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
foreach($tops as $t) {
|
foreach($tops as $t) {
|
||||||
$read = $this->checkRead(0, $t->id, $request->username, $request->password);
|
$read = $this->checkRead(0, $t->id, $r->kero_token);
|
||||||
$replysuu = DB::table('for_posts')->where('top_id', $t->id)->count();
|
$replysuu = DB::table('for_posts')->where('top_id', $t->id)->count();
|
||||||
|
|
||||||
$fplp = $this->getFirstAndLastPosts($t->id);
|
$fplp = $this->getFirstAndLastPosts($t->id);
|
||||||
$userFD = $fplp['first']['date'];
|
$userFD = $fplp['first']['date'];
|
||||||
$userLD = $fplp['last']['date'];
|
$userLD = $fplp['last']['date'];
|
||||||
$userFirst = $this->objUser->getUser($fplp['first']['uid'], $request)->toArray();
|
$userFirst = $this->objUser->getUser($fplp['first']['uid'], $r)->toArray();
|
||||||
$userLast = $this->objUser->getUser($fplp['last']['uid'], $request)->toArray();
|
$userLast = $this->objUser->getUser($fplp['last']['uid'], $r)->toArray();
|
||||||
$showNameF = "";
|
$showNameF = "";
|
||||||
$showColF = "";
|
$showColF = "";
|
||||||
$showNameL = "";
|
$showNameL = "";
|
||||||
|
@ -1745,14 +1745,14 @@ class BoardController extends Controller {
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function browseTopicPosts($tp, $id, $from, $to, Request $request) { // /api/rpc/board/browse/browsetopicposts/tp/id/from/to
|
public function browseTopicPosts($tp, $id, $from, $to, Request $r) { // /api/rpc/board/browse/browsetopicposts/tp/id/from/to
|
||||||
// Load group colours.
|
// Load group colours.
|
||||||
$ucol = $this->objUser->getGroupColours();
|
$ucol = $this->objUser->getGroupColours();
|
||||||
|
|
||||||
// All the user posts' user IDs.
|
// All the user posts' user IDs.
|
||||||
if ($tp == 't') $uid = $this->getUserPosts($id, $from, $to, $request);
|
if ($tp == 't') $uid = $this->getUserPosts($id, $from, $to, $r);
|
||||||
else if ($tp == 'p') $uid = $this->getUserPost($id, $request);
|
else if ($tp == 'p') $uid = $this->getUserPost($id, $r);
|
||||||
else $uid = $this->getPostsOfUser($id, $from, $to, $request);
|
else $uid = $this->getPostsOfUser($id, $from, $to, $r);
|
||||||
$udat = array();
|
$udat = array();
|
||||||
$key = 0;
|
$key = 0;
|
||||||
$ldate = 0;
|
$ldate = 0;
|
||||||
|
@ -1822,7 +1822,7 @@ class BoardController extends Controller {
|
||||||
$key++;
|
$key++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($tp == 't' && $check != 0) {
|
if ($tp == 't' && $check != 0) {
|
||||||
$view = DB::table('for_threads')
|
$view = DB::table('for_threads')
|
||||||
|
@ -1860,9 +1860,9 @@ class BoardController extends Controller {
|
||||||
return $udat;
|
return $udat;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function browsePermissions($uid, Request $request) { // /api/rpc/board/browse/browsepermissions/uid
|
public function browsePermissions($uid, Request $r) { // /api/rpc/board/browse/browsepermissions/uid
|
||||||
// Get user ID.
|
// Get user ID.
|
||||||
$perm = $this->objUser->getUser($uid, $request);
|
$perm = $this->objUser->getUser($uid, $r);
|
||||||
|
|
||||||
// Does the user ID exist? Grand the appropriate rights. Otherwise, use guest.
|
// Does the user ID exist? Grand the appropriate rights. Otherwise, use guest.
|
||||||
if ($uid != 0) {
|
if ($uid != 0) {
|
||||||
|
|
|
@ -23,8 +23,8 @@ class ImageController extends Controller {
|
||||||
$this->objUser = new UserController();
|
$this->objUser = new UserController();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserWithUploads(Request $request) { // /api/rpc/image/get/userwithuploads
|
public function getUserWithUploads(Request $r) { // /api/rpc/image/get/userwithuploads
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['img_viewimg'] == 1) {
|
if ($valid['img_viewimg'] == 1) {
|
||||||
$cols = $this->objUser->getGroupColours()->toArray();
|
$cols = $this->objUser->getGroupColours()->toArray();
|
||||||
|
@ -37,7 +37,7 @@ class ImageController extends Controller {
|
||||||
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
||||||
|
|
||||||
if ($usr != 0) {
|
if ($usr != 0) {
|
||||||
$user = $this->objUser->getUser($usr, $request)->toArray();
|
$user = $this->objUser->getUser($usr, $r)->toArray();
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ class ImageController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAll(Request $request) { // /api/rpc/image/get/all
|
public function getAll(Request $r) { // /api/rpc/image/get/all
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['img_viewimg'] == 1) {
|
if ($valid['img_viewimg'] == 1) {
|
||||||
$cols = $this->objUser->getGroupColours()->toArray();
|
$cols = $this->objUser->getGroupColours()->toArray();
|
||||||
|
@ -92,7 +92,7 @@ class ImageController extends Controller {
|
||||||
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
||||||
|
|
||||||
if ($usr[3] != 0) {
|
if ($usr[3] != 0) {
|
||||||
$user = $this->objUser->getUser($usr[3], $request)->toArray();
|
$user = $this->objUser->getUser($usr[3], $r)->toArray();
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
|
||||||
|
@ -135,14 +135,14 @@ class ImageController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOwn(Request $request) { // /api/rpc/image/get/own
|
public function getOwn(Request $r) { // /api/rpc/image/get/own
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['img_viewimg'] == 1) {
|
if ($valid['img_viewimg'] == 1) {
|
||||||
$cols = $this->objUser->getGroupColours()->toArray();
|
$cols = $this->objUser->getGroupColours()->toArray();
|
||||||
|
@ -159,7 +159,7 @@ class ImageController extends Controller {
|
||||||
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
||||||
|
|
||||||
if ($usr[3] == $check) {
|
if ($usr[3] == $check) {
|
||||||
$user = $this->objUser->getUser($usr[3], $request)->toArray();
|
$user = $this->objUser->getUser($usr[3], $r)->toArray();
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
|
||||||
|
@ -207,8 +207,8 @@ class ImageController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUser($id, Request $request) { // /api/rpc/image/get/user/id
|
public function getUser($id, Request $r) { // /api/rpc/image/get/user/id
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['img_viewimg'] == 1) {
|
if ($valid['img_viewimg'] == 1) {
|
||||||
$cols = $this->objUser->getGroupColours()->toArray();
|
$cols = $this->objUser->getGroupColours()->toArray();
|
||||||
|
@ -221,7 +221,7 @@ class ImageController extends Controller {
|
||||||
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
||||||
|
|
||||||
if ($usr[3] != 0) {
|
if ($usr[3] != 0) {
|
||||||
$user = $this->objUser->getUser($usr[3], $request)->toArray();
|
$user = $this->objUser->getUser($usr[3], $r)->toArray();
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
|
||||||
|
@ -264,14 +264,14 @@ class ImageController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOther(Request $request) { // /api/rpc/image/get/other
|
public function getOther(Request $r) { // /api/rpc/image/get/other
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['img_viewimg'] == 1) {
|
if ($valid['img_viewimg'] == 1) {
|
||||||
$cols = $this->objUser->getGroupColours()->toArray();
|
$cols = $this->objUser->getGroupColours()->toArray();
|
||||||
|
@ -294,7 +294,7 @@ class ImageController extends Controller {
|
||||||
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
||||||
|
|
||||||
if ($usr != $check) {
|
if ($usr != $check) {
|
||||||
$user = $this->objUser->getUser($usr, $request)->toArray();
|
$user = $this->objUser->getUser($usr, $r)->toArray();
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
|
||||||
|
@ -344,34 +344,34 @@ class ImageController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewImage(Request $request) { // /api/rpc/image/view
|
public function viewImage(Request $r) { // /api/rpc/image/view
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['img_viewimg'] == 1) {
|
if ($valid['img_viewimg'] == 1) {
|
||||||
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
|
||||||
|
|
||||||
if (!isset($request->id) || !isset($request->name)) {
|
if (!isset($r->id) || !isset($r->name)) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $protocol.'://'.$_SERVER['SERVER_NAME'].'/assets/images/'.$request->id.'/'.$request->name;
|
return $protocol.'://'.$_SERVER['SERVER_NAME'].'/assets/images/'.$r->id.'/'.$r->name;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return 'Permission denied.';
|
return 'Permission denied.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function uploadImage(Request $request) { // /api/rpc/image/upload
|
public function uploadImage(Request $r) { // /api/rpc/image/upload
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['img_addimg'] == 1) {
|
if ($valid['img_addimg'] == 1) {
|
||||||
if (isset($request->filename)) {
|
if (isset($r->filename)) {
|
||||||
if (!is_dir("assets/images/".$check)) {
|
if (!is_dir("assets/images/".$check)) {
|
||||||
if (!mkdir("assets/images/".$check, 0755, true)) {
|
if (!mkdir("assets/images/".$check, 0755, true)) {
|
||||||
return "Could not make folder ".$check."<br />";
|
return "Could not make folder ".$check."<br />";
|
||||||
|
@ -379,22 +379,22 @@ class ImageController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
$img_dir = "assets/images/".$check."/";
|
$img_dir = "assets/images/".$check."/";
|
||||||
$image = $img_dir . $request->filename;
|
$image = $img_dir . $r->filename;
|
||||||
$imageFileType = array(
|
$imageFileType = array(
|
||||||
'image/png',
|
'image/png',
|
||||||
'image/jpeg',
|
'image/jpeg',
|
||||||
'image/gif'
|
'image/gif'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!in_array($request->filetype, $imageFileType)) {
|
if (!in_array($r->filetype, $imageFileType)) {
|
||||||
return "Only JPG, PNG, JPEG, and GIF are allowed.";
|
return "Only JPG, PNG, JPEG, and GIF are allowed.";
|
||||||
}
|
}
|
||||||
|
|
||||||
$fname = 'assets/images/'.$check.'/'.$request->filename;
|
$fname = 'assets/images/'.$check.'/'.$r->filename;
|
||||||
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $request->thefile));
|
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $r->thefile));
|
||||||
Storage::disk('public')->put($fname, $data);
|
Storage::disk('public')->put($fname, $data);
|
||||||
|
|
||||||
return $request->filename;
|
return $r->filename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -408,29 +408,29 @@ class ImageController extends Controller {
|
||||||
return (count(scandir($dir)) == 2);
|
return (count(scandir($dir)) == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeImage(Request $request) { // /api/rpc/image/remove
|
public function removeImage(Request $r) { // /api/rpc/image/remove
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['img_delotherimg'] == 1) {
|
if ($valid['img_delotherimg'] == 1) {
|
||||||
if (isset($request->name)) {
|
if (isset($r->name)) {
|
||||||
$fname = 'assets/images/'.$request->id.'/'.$request->name;
|
$fname = 'assets/images/'.$r->id.'/'.$r->name;
|
||||||
unlink('storage/'.$fname);
|
unlink('storage/'.$fname);
|
||||||
if ($this->is_dir_empty('storage/assets/images/'.$request->id)) rmdir('storage/assets/images/'.$request->id);
|
if ($this->is_dir_empty('storage/assets/images/'.$r->id)) rmdir('storage/assets/images/'.$r->id);
|
||||||
|
|
||||||
return 'Deleted';
|
return 'Deleted';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (isset($request->name)) {
|
if (isset($r->name)) {
|
||||||
if ($check == $request->id) {
|
if ($check == $r->id) {
|
||||||
if ($valid['img_delownimg'] == 1) {
|
if ($valid['img_delownimg'] == 1) {
|
||||||
$fname = 'assets/images/'.$check.'/'.$request->name;
|
$fname = 'assets/images/'.$check.'/'.$r->name;
|
||||||
unlink('storage/'.$fname);
|
unlink('storage/'.$fname);
|
||||||
if ($this->is_dir_empty('storage/assets/images/'.$check)) rmdir('storage/assets/images/'.$check);
|
if ($this->is_dir_empty('storage/assets/images/'.$check)) rmdir('storage/assets/images/'.$check);
|
||||||
|
|
||||||
|
|
ファイル差分が大きすぎるため省略します
差分を読み込み
|
@ -22,8 +22,8 @@ class PackageController extends Controller {
|
||||||
$this->objPermission = new PermissionController();
|
$this->objPermission = new PermissionController();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get(Request $request) { // /api/rpc/pack/get
|
public function get(Request $r) { // /api/rpc/pack/get
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'err!';
|
return 'err!';
|
||||||
|
|
|
@ -23,12 +23,12 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Posts
|
// Posts
|
||||||
public function getPosts(Request $request) { // /api/rpc/site/post/get/all
|
public function getPosts(Request $r) { // /api/rpc/site/post/get/all
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
// Load group colours.
|
// Load group colours.
|
||||||
$ucol = $this->objUser->getGroupColours();
|
$ucol = $this->objUser->getGroupColours();
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
// Load content.
|
// Load content.
|
||||||
if ($valid['blg_editpost']) {
|
if ($valid['blg_editpost']) {
|
||||||
|
@ -188,9 +188,9 @@ class SiteController extends Controller {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPost($slug, Request $request) { // /api/rpc/site/post/get/slug/slug
|
public function getPost($slug, Request $r) { // /api/rpc/site/post/get/slug/slug
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
// Load group colours.
|
// Load group colours.
|
||||||
$ucol = $this->objUser->getGroupColours();
|
$ucol = $this->objUser->getGroupColours();
|
||||||
|
@ -301,24 +301,24 @@ class SiteController extends Controller {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newPost(Request $request) { // /api/rpc/site/post/new
|
public function newPost(Request $r) { // /api/rpc/site/post/new
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_addpost'] == 1) {
|
if ($valid['blg_addpost'] == 1) {
|
||||||
$pubdate = 0;
|
$pubdate = 0;
|
||||||
|
|
||||||
if ($request->public_status == 1) {
|
if ($r->public_status == 1) {
|
||||||
if ($request->publish_date <= time()) {
|
if ($r->publish_date <= time()) {
|
||||||
return \Response::json(array('error' => '投稿日より公開日の方がもっと古いだと不許可です。'));
|
return \Response::json(array('error' => '投稿日より公開日の方がもっと古いだと不許可です。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pubdate = $request->publish_date;
|
$pubdate = $r->publish_date;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -329,14 +329,14 @@ class SiteController extends Controller {
|
||||||
->insert([
|
->insert([
|
||||||
'user_id' => $check,
|
'user_id' => $check,
|
||||||
'isPost' => 1,
|
'isPost' => 1,
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'slug' => $request->slug,
|
'slug' => $r->slug,
|
||||||
'post_date' => time(),
|
'post_date' => time(),
|
||||||
'publish_date' => $pubdate,
|
'publish_date' => $pubdate,
|
||||||
'sortorder' => 0,
|
'sortorder' => 0,
|
||||||
'public_status' => $request->public_status,
|
'public_status' => $r->public_status,
|
||||||
'isMenu' => 0,
|
'isMenu' => 0,
|
||||||
'message' => $request->message
|
'message' => $r->message
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return \Response::json($add);
|
return \Response::json($add);
|
||||||
|
@ -347,23 +347,23 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editPost(Request $request) { // /api/rpc/site/post/edit
|
public function editPost(Request $r) { // /api/rpc/site/post/edit
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_editpost'] == 1) {
|
if ($valid['blg_editpost'] == 1) {
|
||||||
return DB::table('blg_content')
|
return DB::table('blg_content')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'slug' => $request->slug,
|
'slug' => $r->slug,
|
||||||
'public_status' => $request->public_status,
|
'public_status' => $r->public_status,
|
||||||
'message' => $request->message
|
'message' => $r->message
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -372,17 +372,17 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePost(Request $request) { // /api/rpc/site/post/delete
|
public function deletePost(Request $r) { // /api/rpc/site/post/delete
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_delpost'] == 1) {
|
if ($valid['blg_delpost'] == 1) {
|
||||||
return DB::table('blg_content')->where('id', $request->id)->delete();
|
return DB::table('blg_content')->where('id', $r->id)->delete();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return \Response::json(array('error' => '不許可。'));
|
return \Response::json(array('error' => '不許可。'));
|
||||||
|
@ -560,31 +560,31 @@ class SiteController extends Controller {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newComment(Request $request) { // /api/rpc/site/comment/new
|
public function newComment(Request $r) { // /api/rpc/site/comment/new
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_addcomment'] == 1) {
|
if ($valid['blg_addcomment'] == 1) {
|
||||||
$add = DB::table('blg_comments')
|
$add = DB::table('blg_comments')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'user_id' => $check,
|
'user_id' => $check,
|
||||||
'content_id' => $request->content_id,
|
'content_id' => $r->content_id,
|
||||||
'votes' => 0,
|
'votes' => 0,
|
||||||
'post_date' => time(),
|
'post_date' => time(),
|
||||||
'last_date' => 0,
|
'last_date' => 0,
|
||||||
'isDeleted' => 0,
|
'isDeleted' => 0,
|
||||||
'message' => $request->message,
|
'message' => $r->message,
|
||||||
'ip_address' => $request->ip_address
|
'ip_address' => $r->ip_address
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$g = DB::table('blg_content')->select('slug', 'user_id')->where('id', $request->content_id)->first();
|
$g = DB::table('blg_content')->select('slug', 'user_id')->where('id', $r->content_id)->first();
|
||||||
|
|
||||||
if ($check != $g->user_id) $this->objUser->addNotification($request, $g->user_id, 1, '新規ブログコメント', 'blog/'.$g->slug, 'comment-'.$add);
|
if ($check != $g->user_id) $this->objUser->addNotification($r, $g->user_id, 1, '新規ブログコメント', 'blog/'.$g->slug, 'comment-'.$add);
|
||||||
|
|
||||||
return \Response::json($add);
|
return \Response::json($add);
|
||||||
}
|
}
|
||||||
|
@ -594,30 +594,30 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editComment(Request $request) { // /api/rpc/site/comment/edit
|
public function editComment(Request $r) { // /api/rpc/site/comment/edit
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$owner = DB::table('blg_comments')->select('user_id')->where('id', $request->id)->where('user_id', $request->user)->get()->toArray();
|
$owner = DB::table('blg_comments')->select('user_id')->where('id', $r->id)->where('user_id', $r->user)->get()->toArray();
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_editcomment'] == 1) {
|
if ($valid['blg_editcomment'] == 1) {
|
||||||
return DB::table('blg_comments')
|
return DB::table('blg_comments')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'last_date' => time(),
|
'last_date' => time(),
|
||||||
'message' => $request->message
|
'message' => $r->message
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else if ($valid['blg_delcomment'] == 1 && $owner[0]->user_id == $check) {
|
else if ($valid['blg_delcomment'] == 1 && $owner[0]->user_id == $check) {
|
||||||
return DB::table('blg_comments')
|
return DB::table('blg_comments')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'last_date' => time(),
|
'last_date' => time(),
|
||||||
'message' => $request->message
|
'message' => $r->message
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -626,20 +626,20 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeComment(Request $request) { // /api/rpc/site/comment/remove
|
public function removeComment(Request $r) { // /api/rpc/site/comment/remove
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$owner = DB::table('blg_comments')->select('user_id')->where('id', $request->id)->where('user_id', $request->user)->get()->toArray();
|
$owner = DB::table('blg_comments')->select('user_id')->where('id', $r->id)->where('user_id', $r->user)->get()->toArray();
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_delcomment'] == 1) {
|
if ($valid['blg_delcomment'] == 1) {
|
||||||
$get = DB::table('blg_comments')
|
$get = DB::table('blg_comments')
|
||||||
->select('isDeleted')
|
->select('isDeleted')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$mod = 0;
|
$mod = 0;
|
||||||
|
@ -650,7 +650,7 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
return DB::table('blg_comments')
|
return DB::table('blg_comments')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'isDeleted' => $mod
|
'isDeleted' => $mod
|
||||||
]);
|
]);
|
||||||
|
@ -658,7 +658,7 @@ class SiteController extends Controller {
|
||||||
else if ($valid['blg_delowncomment'] == 1 && $owner[0]->user_id == $check) {
|
else if ($valid['blg_delowncomment'] == 1 && $owner[0]->user_id == $check) {
|
||||||
$get = DB::table('blg_comments')
|
$get = DB::table('blg_comments')
|
||||||
->select('isDeleted')
|
->select('isDeleted')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
foreach ($get as $i) {
|
foreach ($get as $i) {
|
||||||
|
@ -666,7 +666,7 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
return DB::table('blg_comments')
|
return DB::table('blg_comments')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'isDeleted' => 1
|
'isDeleted' => 1
|
||||||
]);
|
]);
|
||||||
|
@ -677,19 +677,19 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function voteComment(Request $request) { // /api/rpc/site/comment/vote
|
public function voteComment(Request $r) { // /api/rpc/site/comment/vote
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_addcomment'] == 1) {
|
if ($valid['blg_addcomment'] == 1) {
|
||||||
$get = DB::table('blg_comments')
|
$get = DB::table('blg_comments')
|
||||||
->select('votes')
|
->select('votes')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$mod = 0;
|
$mod = 0;
|
||||||
|
@ -699,9 +699,9 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
return DB::table('blg_comments')
|
return DB::table('blg_comments')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'votes' => $request->votemod
|
'votes' => $r->votemod
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -771,8 +771,8 @@ class SiteController extends Controller {
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPage($slug, Request $request) { // /api/rpc/site/page/get/slug/slug
|
public function getPage($slug, Request $r) { // /api/rpc/site/page/get/slug/slug
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_editpage'] == 1) {
|
if ($valid['blg_editpage'] == 1) {
|
||||||
return DB::table('blg_content')
|
return DB::table('blg_content')
|
||||||
|
@ -793,14 +793,14 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newPage(Request $request) { // /api/rpc/site/page/new
|
public function newPage(Request $r) { // /api/rpc/site/page/new
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_addpage'] == 1) {
|
if ($valid['blg_addpage'] == 1) {
|
||||||
$lorder = DB::table('blg_content')
|
$lorder = DB::table('blg_content')
|
||||||
|
@ -813,14 +813,14 @@ class SiteController extends Controller {
|
||||||
->insert([
|
->insert([
|
||||||
'user_id' => 0,
|
'user_id' => 0,
|
||||||
'isPost' => 0,
|
'isPost' => 0,
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'slug' => $request->slug,
|
'slug' => $r->slug,
|
||||||
'post_date' => 0,
|
'post_date' => 0,
|
||||||
'publish_date' => 0,
|
'publish_date' => 0,
|
||||||
'sortorder' => ($request->isMenu == 1 ? $lorder : 0),
|
'sortorder' => ($r->isMenu == 1 ? $lorder : 0),
|
||||||
'public_status' => $request->public_status,
|
'public_status' => $r->public_status,
|
||||||
'isMenu' => ($request->isMenu ? 1 : 0),
|
'isMenu' => ($r->isMenu ? 1 : 0),
|
||||||
'message' => $request->message
|
'message' => $r->message
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return \Response::json($add);
|
return \Response::json($add);
|
||||||
|
@ -831,24 +831,24 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editPage(Request $request) { // /api/rpc/site/page/edit
|
public function editPage(Request $r) { // /api/rpc/site/page/edit
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_editpage'] == 1) {
|
if ($valid['blg_editpage'] == 1) {
|
||||||
return DB::table('blg_content')
|
return DB::table('blg_content')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'slug' => $request->slug,
|
'slug' => $r->slug,
|
||||||
'public_status' => $request->public_status,
|
'public_status' => $r->public_status,
|
||||||
'isMenu' => $request->isMenu,
|
'isMenu' => $r->isMenu,
|
||||||
'message' => $request->message
|
'message' => $r->message
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -857,17 +857,17 @@ class SiteController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePage(Request $request) { // /api/rpc/site/page/delete
|
public function deletePage(Request $r) { // /api/rpc/site/page/delete
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return \Response::json(array('error' => 'ログインされませんでした。'));
|
return \Response::json(array('error' => 'ログインされませんでした。'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['blg_delpage'] == 1) {
|
if ($valid['blg_delpage'] == 1) {
|
||||||
return DB::table('blg_content')->where('id', $request->id)->delete();
|
return DB::table('blg_content')->where('id', $r->id)->delete();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return \Response::json(array('error' => '不許可。'));
|
return \Response::json(array('error' => '不許可。'));
|
||||||
|
@ -893,19 +893,19 @@ class SiteController extends Controller {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newPortfolioCategory(Request $request) { // /api/rpc/site/portfolio/newcategory
|
public function newPortfolioCategory(Request $r) { // /api/rpc/site/portfolio/newcategory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editPortfolioCategory(Request $request) { // /api/rpc/site/portfolio/editcategory
|
public function editPortfolioCategory(Request $r) { // /api/rpc/site/portfolio/editcategory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removePortfolioCategory(Request $request) { // /api/rpc/site/portfolio/removecategory
|
public function removePortfolioCategory(Request $r) { // /api/rpc/site/portfolio/removecategory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePortfolioCategory(Request $request) { // /api/rpc/site/portfolio/deletecategory
|
public function deletePortfolioCategory(Request $r) { // /api/rpc/site/portfolio/deletecategory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -918,19 +918,19 @@ class SiteController extends Controller {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newPortfolioItem(Request $request) { // /api/rpc/site/portfolio/newitem
|
public function newPortfolioItem(Request $r) { // /api/rpc/site/portfolio/newitem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editPortfolioItem(Request $request) { // /api/rpc/site/portfolio/edititem
|
public function editPortfolioItem(Request $r) { // /api/rpc/site/portfolio/edititem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removePortfolioItem(Request $request) { // /api/rpc/site/portfolio/removeitem
|
public function removePortfolioItem(Request $r) { // /api/rpc/site/portfolio/removeitem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePortfolioItem(Request $request) { // /api/rpc/site/portfolio/deleteitem
|
public function deletePortfolioItem(Request $r) { // /api/rpc/site/portfolio/deleteitem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -941,17 +941,17 @@ class SiteController extends Controller {
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSettings(Request $request) { // /api/rpc/site/admin/setsettings
|
public function setSettings(Request $r) { // /api/rpc/site/admin/setsettings
|
||||||
return DB::table('blg_settings')
|
return DB::table('blg_settings')
|
||||||
->update([
|
->update([
|
||||||
'sitename' => $request->sitename,
|
'sitename' => $r->sitename,
|
||||||
'description' => $request->description,
|
'description' => $r->description,
|
||||||
'tags' => $request->tags,
|
'tags' => $r->tags,
|
||||||
'blog_status' => $request->blog_status,
|
'blog_status' => $r->blog_status,
|
||||||
'homepage' => $request->homepage,
|
'homepage' => $r->homepage,
|
||||||
'announcement' => $request->announcement,
|
'announcement' => $r->announcement,
|
||||||
'theme' => $request->theme,
|
'theme' => $r->theme,
|
||||||
'locale' => $request->locale
|
'locale' => $r->locale
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,20 +39,20 @@ class StoreController extends Controller {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newGame(Request $request) { // /api/rpc/store/games/newgame
|
public function newGame(Request $r) { // /api/rpc/store/games/newgame
|
||||||
$add = DB::table('str_games')
|
$add = DB::table('str_games')
|
||||||
->insert([
|
->insert([
|
||||||
'name' => $request->name
|
'name' => $r->name
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return \Response::json($add);
|
return \Response::json($add);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editGame(Request $request) { // /api/rpc/store/games/editgame
|
public function editGame(Request $r) { // /api/rpc/store/games/editgame
|
||||||
return DB::table('str_games')
|
return DB::table('str_games')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'name' => $request->name
|
'name' => $r->name
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,23 +141,23 @@ class StoreController extends Controller {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newCategory(Request $request) { // /api/rpc/store/category/newcategory
|
public function newCategory(Request $r) { // /api/rpc/store/category/newcategory
|
||||||
$add = DB::table('str_category')
|
$add = DB::table('str_category')
|
||||||
->insert([
|
->insert([
|
||||||
'name' => $request->name,
|
'name' => $r->name,
|
||||||
'game_id' => $request->game_id,
|
'game_id' => $r->game_id,
|
||||||
'min_screenshots' => $request->min_screenshots
|
'min_screenshots' => $r->min_screenshots
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return \Response::json($add);
|
return \Response::json($add);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editCategory(Request $request) { // /api/rpc/store/category/editcategory
|
public function editCategory(Request $r) { // /api/rpc/store/category/editcategory
|
||||||
return DB::table('str_category')
|
return DB::table('str_category')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'name' => $request->name,
|
'name' => $r->name,
|
||||||
'min_screenshots' => $request->min_screenshots
|
'min_screenshots' => $r->min_screenshots
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,10 +313,10 @@ class StoreController extends Controller {
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateDownloadCount(Request $request) { // /api/rpc/store/entry/updatedownloadcount
|
public function updateDownloadCount(Request $r) { // /api/rpc/store/entry/updatedownloadcount
|
||||||
return DB::table('str_file')
|
return DB::table('str_file')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update(['downloads', $request->downloads]);
|
->update(['downloads', $r->downloads]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function FileSizeConvert($bytes) {
|
public function FileSizeConvert($bytes) {
|
||||||
|
@ -479,8 +479,8 @@ class StoreController extends Controller {
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function makedir(Request $request) {
|
public function makedir(Request $r) {
|
||||||
$id = $request->id;
|
$id = $r->id;
|
||||||
|
|
||||||
if (!mkdir($this->storePath.'/'.$id, 0755, true)) {
|
if (!mkdir($this->storePath.'/'.$id, 0755, true)) {
|
||||||
Log::error('File MKDIR failed: ');
|
Log::error('File MKDIR failed: ');
|
||||||
|
@ -493,29 +493,29 @@ class StoreController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function uploadEntry(Request $request) { // /api/rpc/store/entry/upload
|
public function uploadEntry(Request $r) { // /api/rpc/store/entry/upload
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
$id = $request->id;
|
$id = $r->id;
|
||||||
|
|
||||||
Log::info('Name: '.$request->file('imgfile')); //TMP
|
Log::info('Name: '.$r->file('imgfile')); //TMP
|
||||||
Log::info('Type: '.gettype($request->file('imgfile'))); // TMP
|
Log::info('Type: '.gettype($r->file('imgfile'))); // TMP
|
||||||
|
|
||||||
$request->file('upfile')->move(public_path('storage/store'.$id), $request->file('imgfile')->getClientOriginalName);
|
$r->file('upfile')->move(public_path('storage/store'.$id), $r->file('imgfile')->getClientOriginalName);
|
||||||
$request->file('imgfile')->move(public_path('storage/store'.$id.'/screens'), $request->file('imgfile')->getClientOriginalName);
|
$r->file('imgfile')->move(public_path('storage/store'.$id.'/screens'), $r->file('imgfile')->getClientOriginalName);
|
||||||
|
|
||||||
exit(); // TMP
|
exit(); // TMP
|
||||||
|
|
||||||
$add = DB::table('str_file')
|
$add = DB::table('str_file')
|
||||||
->insert([
|
->insert([
|
||||||
'game_id' => intval($request->game_id),
|
'game_id' => intval($r->game_id),
|
||||||
'cat_id' => intval($request->cat_id),
|
'cat_id' => intval($r->cat_id),
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'version' => $request->version,
|
'version' => $r->version,
|
||||||
'video' => (!empty($request->video) ? $request->video : ''),
|
'video' => (!empty($r->video) ? $r->video : ''),
|
||||||
'description' => $request->description,
|
'description' => $r->description,
|
||||||
'changelog' => '',
|
'changelog' => '',
|
||||||
'warningnote' => (!empty($request->warningnote) ? $request->warningnote : ''),
|
'warningnote' => (!empty($r->warningnote) ? $r->warningnote : ''),
|
||||||
'submit_date' => intval($request->submit_date),
|
'submit_date' => intval($r->submit_date),
|
||||||
'last_date' => intval(0),
|
'last_date' => intval(0),
|
||||||
'views' => intval(0),
|
'views' => intval(0),
|
||||||
'downloads' => intval(0),
|
'downloads' => intval(0),
|
||||||
|
@ -530,29 +530,29 @@ class StoreController extends Controller {
|
||||||
return \Response::json($add);
|
return \Response::json($add);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateEntry(Request $request) { // /api/rpc/store/entry/update
|
public function updateEntry(Request $r) { // /api/rpc/store/entry/update
|
||||||
return DB::table('str_file')
|
return DB::table('str_file')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'cat_id' => $request->cat_id,
|
'cat_id' => $r->cat_id,
|
||||||
'title' => $request->title,
|
'title' => $r->title,
|
||||||
'version' => $request->version,
|
'version' => $r->version,
|
||||||
'description' => $request->description,
|
'description' => $r->description,
|
||||||
'changelog' => $request->changelog,
|
'changelog' => $r->changelog,
|
||||||
'warningnote' => $request->warningnote,
|
'warningnote' => $r->warningnote,
|
||||||
'last_date' => $request->last_date
|
'last_date' => $r->last_date
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function restoreEntry(Request $request) { // /api/rpc/store/entry/restore
|
public function restoreEntry(Request $r) { // /api/rpc/store/entry/restore
|
||||||
return DB::table('str_file')
|
return DB::table('str_file')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update(['isApproved' => 1]);
|
->update(['isApproved' => 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeEntry(Request $request) { // /api/rpc/store/entry/remove
|
public function removeEntry(Request $r) { // /api/rpc/store/entry/remove
|
||||||
return DB::table('str_file')
|
return DB::table('str_file')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update(['isApproved' => 0]);
|
->update(['isApproved' => 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,20 +105,20 @@ class UserController extends Controller {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateUserStatus(Request $request) { // /api/rpc/user/user/updateuserstatus
|
public function updateUserStatus(Request $r) { // /api/rpc/user/user/updateuserstatus
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check != 0) {
|
if ($check != 0) {
|
||||||
return DB::table('usr_profile')
|
return DB::table('usr_profile')
|
||||||
->where('user_id', $check)
|
->where('user_id', $check)
|
||||||
->update([
|
->update([
|
||||||
'ostatus' => $request->ostatus
|
'ostatus' => $r->ostatus
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateUserOnline(Request $request) { // /api/rpc/user/user/updateuseronline
|
public function updateUserOnline(Request $r) { // /api/rpc/user/user/updateuseronline
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check != 0) {
|
if ($check != 0) {
|
||||||
return DB::table('usr_details')
|
return DB::table('usr_details')
|
||||||
|
@ -129,7 +129,7 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUsers(Request $request) { // /api/rpc/user/user/getusers
|
public function getUsers(Request $r) { // /api/rpc/user/user/getusers
|
||||||
$getting = array(
|
$getting = array(
|
||||||
'users.id',
|
'users.id',
|
||||||
'usr_perm_module.name as group_name',
|
'usr_perm_module.name as group_name',
|
||||||
|
@ -143,7 +143,7 @@ class UserController extends Controller {
|
||||||
'usr_profile.country'
|
'usr_profile.country'
|
||||||
);
|
);
|
||||||
|
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['usr_emailshow'] == 1) {
|
if ($valid['usr_emailshow'] == 1) {
|
||||||
array_push($getting, 'users.email');
|
array_push($getting, 'users.email');
|
||||||
|
@ -162,7 +162,7 @@ class UserController extends Controller {
|
||||||
->get($getting);
|
->get($getting);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUser($id, Request $request) { // /api/rpc/user/user/getuser/id/uid
|
public function getUser($id, Request $r) { // /api/rpc/user/user/getuser/id/uid
|
||||||
$getting = array(
|
$getting = array(
|
||||||
'users.id',
|
'users.id',
|
||||||
'users.username',
|
'users.username',
|
||||||
|
@ -194,8 +194,8 @@ class UserController extends Controller {
|
||||||
'usr_contacts.twitter'
|
'usr_contacts.twitter'
|
||||||
);
|
);
|
||||||
|
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
$cols = $this->getGroupColours()->toArray();
|
$cols = $this->getGroupColours()->toArray();
|
||||||
|
|
||||||
if ($valid['usr_editother'] == 1 || $id == $check) {
|
if ($valid['usr_editother'] == 1 || $id == $check) {
|
||||||
|
@ -372,8 +372,8 @@ class UserController extends Controller {
|
||||||
->first()->total_threads;
|
->first()->total_threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addOwner(Request $request) { // /api/rpc/user/owner/addowner
|
public function addOwner(Request $r) { // /api/rpc/user/owner/addowner
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
|
@ -381,16 +381,16 @@ class UserController extends Controller {
|
||||||
else {
|
else {
|
||||||
$add = DB::table('str_owners')
|
$add = DB::table('str_owners')
|
||||||
->insert([
|
->insert([
|
||||||
'user_id' => $request->user_id,
|
'user_id' => $r->user_id,
|
||||||
'file_id' => $request->file_id
|
'file_id' => $r->file_id
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return \Response::json($add);
|
return \Response::json($add);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateTotalPostCount(Request $request) { // /api/rpc/user/user/updatetotalpostcount
|
public function updateTotalPostCount(Request $r) { // /api/rpc/user/user/updatetotalpostcount
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
|
@ -407,20 +407,20 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateTotalTopicCount(Request $request) { // /api/rpc/user/user/updatetotaltopiccount
|
public function updateTotalTopicCount(Request $r) { // /api/rpc/user/user/updatetotaltopiccount
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$getPC = $this->getTotalPostCount($request->user_id);
|
$getPC = $this->getTotalPostCount($r->user_id);
|
||||||
$getTC = $this->getTotalTopicCount($request->user_id);
|
$getTC = $this->getTotalTopicCount($r->user_id);
|
||||||
$getPC++;
|
$getPC++;
|
||||||
$getTC++;
|
$getTC++;
|
||||||
|
|
||||||
return DB::table('usr_details')
|
return DB::table('usr_details')
|
||||||
->where('user_id', $request->user_id)
|
->where('user_id', $r->user_id)
|
||||||
->update([
|
->update([
|
||||||
'total_posts' => $getPC,
|
'total_posts' => $getPC,
|
||||||
'total_threads' => $getTC
|
'total_threads' => $getTC
|
||||||
|
@ -445,21 +445,21 @@ class UserController extends Controller {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function avatarUpload(Request $request) { // /api/rpc/user/user/avatarupload
|
public function avatarUpload(Request $r) { // /api/rpc/user/user/avatarupload
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
$user = 0;
|
$user = 0;
|
||||||
|
|
||||||
if ($valid['usr_editother'] == 1) $user = $request->id;
|
if ($valid['usr_editother'] == 1) $user = $r->id;
|
||||||
else $user = $check;
|
else $user = $check;
|
||||||
|
|
||||||
if ($valid['usr_editprofile'] == 1) {
|
if ($valid['usr_editprofile'] == 1) {
|
||||||
if (isset($request->filename)) {
|
if (isset($r->filename)) {
|
||||||
if (!is_dir("assets/avatars/".$check)) {
|
if (!is_dir("assets/avatars/".$check)) {
|
||||||
if (!mkdir("assets/avatars/".$check, 0755, true)) {
|
if (!mkdir("assets/avatars/".$check, 0755, true)) {
|
||||||
return "Could not make folder ".$check."<br />";
|
return "Could not make folder ".$check."<br />";
|
||||||
|
@ -467,22 +467,22 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
$img_dir = "assets/avatars/".$check."/";
|
$img_dir = "assets/avatars/".$check."/";
|
||||||
$image = $img_dir . $request->filename;
|
$image = $img_dir . $r->filename;
|
||||||
$imageFileType = array(
|
$imageFileType = array(
|
||||||
'image/png',
|
'image/png',
|
||||||
'image/jpeg',
|
'image/jpeg',
|
||||||
'image/gif'
|
'image/gif'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!in_array($request->filetype, $imageFileType)) {
|
if (!in_array($r->filetype, $imageFileType)) {
|
||||||
return "Only JPG, PNG, JPEG, and GIF are allowed.";
|
return "Only JPG, PNG, JPEG, and GIF are allowed.";
|
||||||
}
|
}
|
||||||
|
|
||||||
$fname = 'assets/avatars/'.$user.'/'.$request->filename;
|
$fname = 'assets/avatars/'.$user.'/'.$r->filename;
|
||||||
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $request->thefile));
|
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $r->thefile));
|
||||||
Storage::disk('public')->put($fname, $data);
|
Storage::disk('public')->put($fname, $data);
|
||||||
|
|
||||||
return $request->filename;
|
return $r->filename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -491,77 +491,77 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editUser(Request $request) { // /api/rpc/user/user/edit
|
public function editUser(Request $r) { // /api/rpc/user/user/edit
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['usr_editprofile'] == 1) {
|
if ($valid['usr_editprofile'] == 1) {
|
||||||
if (isset($request->newPassword)) {
|
if (isset($r->newPassword)) {
|
||||||
DB::table('users')
|
DB::table('users')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'password' => $request->newPassword
|
'password' => $r->newPassword
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if (isset($request->email)) {
|
if (isset($r->email)) {
|
||||||
DB::table('users')
|
DB::table('users')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'email' => $request->email
|
'email' => $r->email
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isset($request->website_link) ||
|
isset($r->website_link) ||
|
||||||
isset($request->website_name) ||
|
isset($r->website_name) ||
|
||||||
isset($request->youtube_link) ||
|
isset($r->youtube_link) ||
|
||||||
isset($request->youtube_name) ||
|
isset($r->youtube_name) ||
|
||||||
isset($request->niconico) ||
|
isset($r->niconico) ||
|
||||||
isset($request->pixiv) ||
|
isset($r->pixiv) ||
|
||||||
isset($request->discord) ||
|
isset($r->discord) ||
|
||||||
isset($request->mastodon) ||
|
isset($r->mastodon) ||
|
||||||
isset($request->twitter)
|
isset($r->twitter)
|
||||||
) {
|
) {
|
||||||
DB::table('usr_contacts')
|
DB::table('usr_contacts')
|
||||||
->where('user_id', $request->id)
|
->where('user_id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'website_link' => ($request->website_link != '' ? $request->website_link : ''),
|
'website_link' => ($r->website_link != '' ? $r->website_link : ''),
|
||||||
'website_name' => ($request->website_name != '' ? $request->website_name : ''),
|
'website_name' => ($r->website_name != '' ? $r->website_name : ''),
|
||||||
'youtube_link' => ($request->youtube_link != '' ? $request->youtube_link : ''),
|
'youtube_link' => ($r->youtube_link != '' ? $r->youtube_link : ''),
|
||||||
'youtube_name' => ($request->youtube_name != '' ? $request->youtube_name : ''),
|
'youtube_name' => ($r->youtube_name != '' ? $r->youtube_name : ''),
|
||||||
'niconico' => ($request->niconico != '' ? $request->niconico : ''),
|
'niconico' => ($r->niconico != '' ? $r->niconico : ''),
|
||||||
'pixiv' => ($request->pixiv != '' ? $request->pixiv : ''),
|
'pixiv' => ($r->pixiv != '' ? $r->pixiv : ''),
|
||||||
'discord' => ($request->discord != '' ? $request->discord : ''),
|
'discord' => ($r->discord != '' ? $r->discord : ''),
|
||||||
'mastodon' => ($request->mastodon != '' ? $request->mastodon : ''),
|
'mastodon' => ($r->mastodon != '' ? $r->mastodon : ''),
|
||||||
'twitter' => ($request->twitter != '' ? $request->twitter : '')
|
'twitter' => ($r->twitter != '' ? $r->twitter : '')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($request->group) && $valid['usr_editother']) {
|
if (isset($r->group) && $valid['usr_editother']) {
|
||||||
DB::table('usr_perm_id')
|
DB::table('usr_perm_id')
|
||||||
->where('user_id', $request->id)
|
->where('user_id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'perm_id' => $request->group
|
'perm_id' => $r->group
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($request->avatar)) {
|
if (isset($r->avatar)) {
|
||||||
DB::table('usr_profile')
|
DB::table('usr_profile')
|
||||||
->where('user_id', $request->id)
|
->where('user_id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'avatar' => ($request->avatar != '' ? $request->avatar : '')
|
'avatar' => ($r->avatar != '' ? $r->avatar : '')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($request->avatarRemove)) {
|
if (isset($r->avatarRemove)) {
|
||||||
if ($request->avatarRemove) {
|
if ($r->avatarRemove) {
|
||||||
DB::table('usr_profile')
|
DB::table('usr_profile')
|
||||||
->where('user_id', $request->id)
|
->where('user_id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'avatar' => ''
|
'avatar' => ''
|
||||||
]);
|
]);
|
||||||
|
@ -569,28 +569,28 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isset($request->gender) ||
|
isset($r->gender) ||
|
||||||
isset($request->aboutSelf) ||
|
isset($r->aboutSelf) ||
|
||||||
isset($request->signature) ||
|
isset($r->signature) ||
|
||||||
isset($request->poststyle) ||
|
isset($r->poststyle) ||
|
||||||
isset($request->nameStyle) ||
|
isset($r->nameStyle) ||
|
||||||
isset($request->displayName) ||
|
isset($r->displayName) ||
|
||||||
isset($request->memberTitle) ||
|
isset($r->memberTitle) ||
|
||||||
isset($request->birthDay) ||
|
isset($r->birthDay) ||
|
||||||
isset($request->country)
|
isset($r->country)
|
||||||
) {
|
) {
|
||||||
DB::table('usr_profile')
|
DB::table('usr_profile')
|
||||||
->where('user_id', $request->id)
|
->where('user_id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'gender' => $request->gender,
|
'gender' => $r->gender,
|
||||||
'bio' => ($request->aboutSelf != '' ? $request->aboutSelf : ''),
|
'bio' => ($r->aboutSelf != '' ? $r->aboutSelf : ''),
|
||||||
'post_style' => ($request->poststyle != '' ? $request->poststyle : ''),
|
'post_style' => ($r->poststyle != '' ? $r->poststyle : ''),
|
||||||
'signature' => ($request->signature != '' ? $request->signature : ''),
|
'signature' => ($r->signature != '' ? $r->signature : ''),
|
||||||
'name_style' => ($request->nameStyle != '' ? $request->nameStyle : ''),
|
'name_style' => ($r->nameStyle != '' ? $r->nameStyle : ''),
|
||||||
'display_name' => ($request->displayName != '' ? $request->displayName : ''),
|
'display_name' => ($r->displayName != '' ? $r->displayName : ''),
|
||||||
'member_title' => ($request->memberTitle != '' ? $request->memberTitle : ''),
|
'member_title' => ($r->memberTitle != '' ? $r->memberTitle : ''),
|
||||||
'birthday' => ($request->birthDay != 0 ? $request->birthDay : 0),
|
'birthday' => ($r->birthDay != 0 ? $r->birthDay : 0),
|
||||||
'country' => $request->country
|
'country' => $r->country
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,9 +608,9 @@ class UserController extends Controller {
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getComments ($id, Request $request) { // /api/rpc/user/comment/get/id
|
public function getComments ($id, Request $r) { // /api/rpc/user/comment/get/id
|
||||||
$cols = $this->getGroupColours()->toArray();
|
$cols = $this->getGroupColours()->toArray();
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['usr_viewcomment'] == 1) {
|
if ($valid['usr_viewcomment'] == 1) {
|
||||||
$come = array();
|
$come = array();
|
||||||
|
@ -629,7 +629,7 @@ class UserController extends Controller {
|
||||||
|
|
||||||
// Foreach, new getter but check on replies, and only if isDel is 0.
|
// Foreach, new getter but check on replies, and only if isDel is 0.
|
||||||
foreach ($get as $g) {
|
foreach ($get as $g) {
|
||||||
$user = $this->getUser($g->user_id, $request)->toArray();
|
$user = $this->getUser($g->user_id, $r)->toArray();
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
|
||||||
|
@ -675,9 +675,9 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getReplies ($id, Request $request) { // /api/rpc/user/comment/reply/id
|
public function getReplies ($id, Request $r) { // /api/rpc/user/comment/reply/id
|
||||||
$cols = $this->getGroupColours()->toArray();
|
$cols = $this->getGroupColours()->toArray();
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['usr_viewcomment'] == 1) {
|
if ($valid['usr_viewcomment'] == 1) {
|
||||||
$come = array();
|
$come = array();
|
||||||
|
@ -696,7 +696,7 @@ class UserController extends Controller {
|
||||||
|
|
||||||
// Foreach, new getter but check on replies, and only if isDel is 0.
|
// Foreach, new getter but check on replies, and only if isDel is 0.
|
||||||
foreach ($get as $g) {
|
foreach ($get as $g) {
|
||||||
$user = $this->getUser($g->user_id, $request)->toArray();
|
$user = $this->getUser($g->user_id, $r)->toArray();
|
||||||
$showName = "";
|
$showName = "";
|
||||||
$showCol = "";
|
$showCol = "";
|
||||||
|
|
||||||
|
@ -743,28 +743,28 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addComment (Request $request) { // /api/rpc/user/comment/add
|
public function addComment (Request $r) { // /api/rpc/user/comment/add
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['usr_addcomment'] == 1) {
|
if ($valid['usr_addcomment'] == 1) {
|
||||||
$add = DB::table('usr_comments')
|
$add = DB::table('usr_comments')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'user_id' => $check,
|
'user_id' => $check,
|
||||||
'profile_id' => $request->profile_id,
|
'profile_id' => $r->profile_id,
|
||||||
'reply_id' => ($request->reply_id > 0 ? $request->reply_id : 0),
|
'reply_id' => ($r->reply_id > 0 ? $r->reply_id : 0),
|
||||||
'postdate' => time(),
|
'postdate' => time(),
|
||||||
'message' => $request->message,
|
'message' => $r->message,
|
||||||
'isEdit' => 0,
|
'isEdit' => 0,
|
||||||
'isDel' => 0
|
'isDel' => 0
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($check != $request->profile_id) $this->addNotification($request, $request->profile_id, 2, '新規プロファイルコメント', 'profile/'.$request->profile_id, 'comment-'.$add);
|
if ($check != $r->profile_id) $this->addNotification($r, $r->profile_id, 2, '新規プロファイルコメント', 'profile/'.$r->profile_id, 'comment-'.$add);
|
||||||
|
|
||||||
return \Response::json($add);
|
return \Response::json($add);
|
||||||
}
|
}
|
||||||
|
@ -774,20 +774,20 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editComment (Request $request) { // /api/rpc/user/comment/edit
|
public function editComment (Request $r) { // /api/rpc/user/comment/edit
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['usr_editowncomment'] == 1) {
|
if ($valid['usr_editowncomment'] == 1) {
|
||||||
DB::table('usr_comments')
|
DB::table('usr_comments')
|
||||||
->where('profile_id', $request->profile_id)
|
->where('profile_id', $r->profile_id)
|
||||||
->update([
|
->update([
|
||||||
'message' => $request->message,
|
'message' => $r->message,
|
||||||
'isEdit' => 1
|
'isEdit' => 1
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -799,18 +799,18 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteComment (Request $request) { // /api/rpc/user/comment/delete
|
public function deleteComment (Request $r) { // /api/rpc/user/comment/delete
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['usr_delcomment'] == 1) {
|
if ($valid['usr_delcomment'] == 1) {
|
||||||
DB::table('usr_comments')
|
DB::table('usr_comments')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'isDel' => 1
|
'isDel' => 1
|
||||||
]);
|
]);
|
||||||
|
@ -823,18 +823,18 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function undeleteComment (Request $request) { // /api/rpc/user/comment/undelete
|
public function undeleteComment (Request $r) { // /api/rpc/user/comment/undelete
|
||||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check == 0) {
|
if ($check == 0) {
|
||||||
return 'Err!';
|
return 'Err!';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
$valid = $this->objAuth->getPermissions($r->kero_token);
|
||||||
|
|
||||||
if ($valid['usr_delcomment'] == 1) {
|
if ($valid['usr_delcomment'] == 1) {
|
||||||
DB::table('usr_comments')
|
DB::table('usr_comments')
|
||||||
->where('id', $request->id)
|
->where('id', $r->id)
|
||||||
->update([
|
->update([
|
||||||
'isDel' => 0
|
'isDel' => 0
|
||||||
]);
|
]);
|
||||||
|
@ -848,7 +848,7 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNotification(Request $r) { // /api/rpc/user/notification/get
|
public function getNotification(Request $r) { // /api/rpc/user/notification/get
|
||||||
$check = $this->objAuth->checkLegit($r->username, $r->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check != 0) {
|
if ($check != 0) {
|
||||||
$get = DB::table('usr_notification')
|
$get = DB::table('usr_notification')
|
||||||
|
@ -878,7 +878,7 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addNotification(Request $r, $uid, $aid, $txt, $sec, $goto) { // /api/rpc/user/notification/add
|
public function addNotification(Request $r, $uid, $aid, $txt, $sec, $goto) { // /api/rpc/user/notification/add
|
||||||
$check = $this->objAuth->checkLegit($r->username, $r->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check != 0) {
|
if ($check != 0) {
|
||||||
$add = DB::table('usr_notification')
|
$add = DB::table('usr_notification')
|
||||||
|
@ -895,7 +895,7 @@ class UserController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delNotification(Request $r) { // /api/rpc/user/notification/del
|
public function delNotification(Request $r) { // /api/rpc/user/notification/del
|
||||||
$check = $this->objAuth->checkLegit($r->username, $r->password);
|
$check = $this->objAuth->checkLegit($r->kero_token);
|
||||||
|
|
||||||
if ($check != 0) {
|
if ($check != 0) {
|
||||||
return DB::table('usr_notification')
|
return DB::table('usr_notification')
|
||||||
|
|
新しいイシューから参照