Skip to content

Commit

Permalink
Merge 7ae57f2 into 11c0eb0
Browse files Browse the repository at this point in the history
  • Loading branch information
PSkierniewski committed Mar 24, 2016
2 parents 11c0eb0 + 7ae57f2 commit f7706ca
Show file tree
Hide file tree
Showing 377 changed files with 12,640 additions and 13,640 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ OAUTH_TWITTER_CLIENT_SECRET=
VANILLA_FORUM_DOMAIN=
VANILLA_FORUM_CLIENT_ID=
VANILLA_FORUM_SECRET=

DISQUS_API_KEY=
DISQUS_API_SECRET=
DISQUS_DOMAIN=
2 changes: 1 addition & 1 deletion app/Http/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct()
/** @TODO We need better way to access langs */
$langRepository = App::make('Gzero\Repository\LangRepository');
$this->lang = $langRepository->getCurrent();
$this->langs = $langRepository->getAll();
$this->langs = $langRepository->getAllEnabled();
$this->viewShareLangs();
}

Expand Down
6 changes: 6 additions & 0 deletions app/Http/Controllers/DevController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace App\Http\Controllers;

use Gzero\Repository\ContentRepository;
use Illuminate\Support\Facades\App;

/**
* This file is part of the GZERO CMS package.
Expand All @@ -17,6 +18,11 @@ class DevController extends BaseController {

public function __construct(ContentRepository $repository)
{
// show dev page only for logged users
if (!app('auth')->check() || !app('auth')->user()->isAdmin) {
App::abort(404);
}

parent::__construct();
$this->repository = $repository;
}
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public function index(Request $request)
],
[
['isPromoted', 'DESC'],
['isSticky', 'DESC']
['isSticky', 'DESC'],
['publishedAt', 'DESC']
],
$request->get('page', 1),
option('general', 'defaultPageSize', 20)
Expand Down
10 changes: 7 additions & 3 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Password;


/**
Expand Down Expand Up @@ -86,6 +87,9 @@ public function postLogin()

public function register()
{
if (Auth::check()) {
return redirect()->to('home');
}
return view('auth.register');
}

Expand Down Expand Up @@ -145,7 +149,7 @@ function ($message) use ($input, $subject) {
public function remind()
{
if (Auth::check()) {
return redirect()->to('/');
return redirect()->to('home');
}
return view('auth.password');
}
Expand All @@ -159,7 +163,7 @@ public function postRemind()
{
try {
$input = $this->validator->validate('remind');
$response = Password::remind(
$response = Password::sendResetLink(
$input,
function ($message) {
$message->subject(Lang::get('emails.passwordReminder.title'));
Expand All @@ -177,7 +181,7 @@ function ($message) {
]
);
return redirect()->back()->withInput();
case Password::REMINDER_SENT:
case Password::RESET_LINK_SENT:
Session::flash(
'messages',
[
Expand Down
44 changes: 43 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,49 @@ class AppServiceProvider extends AbstractServiceProvider {
*/
public function boot()
{
//
view()->composer(
'includes.disqus.disqus',
function ($view) {
$data = [];
$user = auth()->user();
if ($user) {
$data = [
"id" => $user["id"],
"username" => $user["firstName"] . ' ' . $user["lastName"],
"email" => $user["email"],
//"avatar" => $user["avatar"],
];
}

function dsq_hmacsha1($data, $key)
{
$blockSize = 64;
if (strlen($key) > $blockSize) {
$key = pack('H*', sha1($key));
}
$key = str_pad($key, $blockSize, chr(0x00));
$ipad = str_repeat(chr(0x36), $blockSize);
$opad = str_repeat(chr(0x5c), $blockSize);
$hmac = pack(
'H*',
sha1(
($key ^ $opad) . pack(
'H*',
sha1(
($key ^ $ipad) . $data
)
)
)
);
return bin2hex($hmac);
}

$message = base64_encode(json_encode($data));
$timestamp = time();
$hmac = dsq_hmacsha1($message . ' ' . $timestamp, config('disqus.api_secret'));
$view->with('remoteAuthS3', "$message $hmac $timestamp");
}
);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
}
],
"require": {
"gzero/cms": "0.*",
"gzero/api": "0.*",
"gzero/admin": "0.*",
"gzero/social": "^1.0",
"gzero/cms": "dev-master as 0.0.5",
"gzero/api": "dev-master as 0.0.5",
"gzero/admin": "dev-master as 0.0.5",
"gzero/social": "dev-master as 1.0",
"gzero/vanilla-integration": "^1.0",
"thomaswelton/laravel-gravatar": "~1.0",
"predis/predis": "1.0.*"
Expand Down
Loading

0 comments on commit f7706ca

Please sign in to comment.