ROの確認
このコミットが含まれているのは:
コミット
c428a83203
|
@ -1569,17 +1569,18 @@ class BoardController extends Controller {
|
|||
if ($tp == 't') $tlock = $this->getTopicLock($id);
|
||||
else $tlock = $this->getTopicLock($tid);
|
||||
$glock = false;
|
||||
if ($tlock[0]->lock == 1) $glock = true;
|
||||
|
||||
if ($tlock[0]->lock == 0) $glock = false;
|
||||
else $glock = true;
|
||||
// Is this topic read only?
|
||||
$fro = $this->getReadOnly($tinfo[0]->for_id);
|
||||
$gro = false;
|
||||
if ($fro == 1) $gro = true;
|
||||
|
||||
// Is this topic pinned?
|
||||
if ($tp == 't') $tpin = $this->getTopicPin($id);
|
||||
else $tpin = $this->getTopicPin($tid);
|
||||
$gpin = false;
|
||||
|
||||
if ($tpin[0]->sticky == 0) $gpin = false;
|
||||
else $gpin = true;
|
||||
if ($tpin[0]->sticky == 1) $gpin = true;
|
||||
|
||||
if ($tp == 'p') {
|
||||
// Compile.
|
||||
|
@ -1591,7 +1592,8 @@ class BoardController extends Controller {
|
|||
'forName' => $finfo[0]->title,
|
||||
'catName' => $cinfo[0]->title,
|
||||
'lock' => $glock,
|
||||
'pin' => $gpin
|
||||
'pin' => $gpin,
|
||||
'ro' => $gro
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
@ -1605,7 +1607,8 @@ class BoardController extends Controller {
|
|||
'maxPage' => ceil($pcount / $to),
|
||||
'posts' => $pcount,
|
||||
'lock' => $glock,
|
||||
'pin' => $gpin
|
||||
'pin' => $gpin,
|
||||
'ro' => $gro
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Http\Controllers\AuthController;
|
||||
use App\Http\Controllers\UserController;
|
||||
use App\Http\Controllers\PermissionController; // Remove permission controller soon.
|
||||
|
||||
class PackageController extends Controller {
|
||||
private $objAuth;
|
||||
private $objUser;
|
||||
private $objPermission;
|
||||
|
||||
public function __construct() {
|
||||
$this->objAuth = new AuthController();
|
||||
$this->objUser = new UserController();
|
||||
$this->objPermission = new PermissionController();
|
||||
}
|
||||
|
||||
public function get(Request $request) { // /api/rpc/pack/get
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'err!';
|
||||
}
|
||||
else {
|
||||
return DB::table('pck_tracks')
|
||||
->select('*')
|
||||
->where('user_id', $check)
|
||||
->orderBy('id', 'desc')
|
||||
->get();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ class Kernel extends HttpKernel
|
|||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
// \App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Package class
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These are the API routes corresponding to board.
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/api/rpc/pack/get', 'PackageController@get');
|
|
@ -14,6 +14,7 @@
|
|||
require(__DIR__.'/class/board.php');
|
||||
require(__DIR__.'/class/image.php');
|
||||
require(__DIR__.'/class/invoice.php');
|
||||
require(__DIR__.'/class/pack.php');
|
||||
require(__DIR__.'/class/site.php');
|
||||
require(__DIR__.'/class/store.php');
|
||||
require(__DIR__.'/class/user.php');
|
||||
|
|
新しいイシューから参照