Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into 2.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	app/config/production/session.example.php
#	app/config/staging/session.example.php
#	app/config/version.php
#	app/models/User.php
  • Loading branch information
snipe committed Jul 9, 2015
2 parents 2d10931 + 9936cf4 commit e1724cf
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ composer.phar
/app/database/*.sqlite
/app/storage/meta/services.json
/app/config/*/mail.php
/app/config/*/session.php
/app/config/*/database.php
/app/config/*/app.php
public/packages/*
Expand All @@ -23,9 +24,5 @@ public/uploads/logo.png
.siteflow
public/assets/.siteflow
.settings/settings.json
app/config/packages/schickling/backup/config.php
app/config/packages/fideloper/proxy/config.php
app/storage/dumps/20150619212924.sql
app/config/staging/session.php
app/config/production/session.php
app/config/local/session.php


14 changes: 14 additions & 0 deletions app/config/production/session.example.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,18 @@

'secure' => false,


/*
|--------------------------------------------------------------------------
| Allow multiple logins from different devices at the same time
|--------------------------------------------------------------------------
|
| By default, if a user logs into an account where someone is already
| logged in, the previous user will be logged out. We recommend leaving
| this set to false for security reasons.
|
*/

'multi_login' => false,

);
16 changes: 15 additions & 1 deletion app/config/staging/session.example.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@
|
*/

'secure' => false,
'secure' => true,


/*
|--------------------------------------------------------------------------
| Allow multiple logins from different devices at the same time
|--------------------------------------------------------------------------
|
| By default, if a user logs into an account where someone is already
| logged in, the previous user will be logged out. We recommend leaving
| this set to false for security reasons.
|
*/

'multi_login' => true,

);
19 changes: 19 additions & 0 deletions app/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,24 @@ public function scopeGetNotDeleted($query)
return $query->whereNull('deleted_at');
}

/**
* Override the SentryUser getPersistCode method for
* multiple logins at one time
**/
public function getPersistCode()
{

if (!Config::get('session.multi_login') || (!$this->persist_code))
{
$this->persist_code = $this->getRandomString();

// Our code got hashed
$persistCode = $this->persist_code;
$this->save();
return $persistCode;
}
return $this->persist_code;
}


}

0 comments on commit e1724cf

Please sign in to comment.