Skip to content

Commit

Permalink
Merge pull request #27 from GrupaZero/bugs_fixes
Browse files Browse the repository at this point in the history
Bugs fixes
  • Loading branch information
PSkierniewski committed Mar 26, 2016
2 parents 11c0eb0 + e069a23 commit e43b4c5
Show file tree
Hide file tree
Showing 377 changed files with 12,690 additions and 13,642 deletions.
4 changes: 4 additions & 0 deletions .env.example
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
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
@@ -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
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
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
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
66 changes: 66 additions & 0 deletions changelog.md
@@ -0,0 +1,66 @@
###Changelog:
##v0.0.5
*GZERO PLATFORM*

- Added logo image
- Added favicon
- Added title attribute to content links in category and homepage views
- Added language switcher
- Added sidebarLeft and sidebarRight blade layouts for user account page
- Added cookies policy information bar
- Added 'publishedAt', 'DESC' sort option for entries on homepage
- Added google analytics script in head with googleAnalyticsId from seo options
- Added disqus integration
- Added colorbox
- Fixed $langs in views, sto that it contains only enabled languages
- Fixed dev page, so it can be view only by admin users
- Fixed register route allowing logged in users
- Page title for from config instead of options
- Changed html lang attribute, so that it corresponds with current language
- Replaced LESS with SCSS files
- Updated password reminder code and translations
- Added responsive theme

*GZERO ADMIN*

- Prevent the user deleting their account
- Fixed language issues when multi language option is disabled
- Fixed translation issues
- Content 'theme' can now be edited
- CKEditor - Allow class attribute on html elements
- CKEditor - added 'encode' email protection method
- CKEditor - Added Youtube embed plugin
- CKEditor - Added advanced tab in image and link windows

*GZERO API*

- Codeception tests fixes

*GZERO CMS*

- Fixed block finder for static pages when multi language is disabled
- Added 'publishedAt', 'DESC' sort option for category children's in category handler
- Fixed DynamicRouter to use url without query string, so that pagination can work
- Fixed Block finder to show hidden blocks on root pages
- Fixed force delete bug, to properly delete thrashed contents
- Added cookies policy url option
- Added Mysql backup & restore artisan command

*GZERO SOCIAL*

- Added BaseController as parent controller so that $langs variables will be available in view
- CSS 'margin-zero-top' class replaced with 'm0' class from new platform style

##v0.0.4
- Docker improvements
- Ability to disable multi language

##v0.0.3
- Added blocks
- Added docker

##v0.0.2
- Content translations management implementation on frontend and backend

##v0.0.1
- Migration on Laravel 5

0 comments on commit e43b4c5

Please sign in to comment.