Skip to content

Commit e1724cf

Browse files
committed
Merge remote-tracking branch 'origin/develop' into 2.0
# Conflicts: # .gitignore # app/config/production/session.example.php # app/config/staging/session.example.php # app/config/version.php # app/models/User.php
2 parents 2d10931 + 9936cf4 commit e1724cf

File tree

4 files changed

+51
-7
lines changed

4 files changed

+51
-7
lines changed

.gitignore

+3-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ composer.phar
77
/app/database/*.sqlite
88
/app/storage/meta/services.json
99
/app/config/*/mail.php
10+
/app/config/*/session.php
1011
/app/config/*/database.php
1112
/app/config/*/app.php
1213
public/packages/*
@@ -23,9 +24,5 @@ public/uploads/logo.png
2324
.siteflow
2425
public/assets/.siteflow
2526
.settings/settings.json
26-
app/config/packages/schickling/backup/config.php
27-
app/config/packages/fideloper/proxy/config.php
28-
app/storage/dumps/20150619212924.sql
29-
app/config/staging/session.php
30-
app/config/production/session.php
31-
app/config/local/session.php
27+
28+

app/config/production/session.example.php

+14
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,18 @@
137137

138138
'secure' => false,
139139

140+
141+
/*
142+
|--------------------------------------------------------------------------
143+
| Allow multiple logins from different devices at the same time
144+
|--------------------------------------------------------------------------
145+
|
146+
| By default, if a user logs into an account where someone is already
147+
| logged in, the previous user will be logged out. We recommend leaving
148+
| this set to false for security reasons.
149+
|
150+
*/
151+
152+
'multi_login' => false,
153+
140154
);

app/config/staging/session.example.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,20 @@
135135
|
136136
*/
137137

138-
'secure' => false,
138+
'secure' => true,
139+
140+
141+
/*
142+
|--------------------------------------------------------------------------
143+
| Allow multiple logins from different devices at the same time
144+
|--------------------------------------------------------------------------
145+
|
146+
| By default, if a user logs into an account where someone is already
147+
| logged in, the previous user will be logged out. We recommend leaving
148+
| this set to false for security reasons.
149+
|
150+
*/
151+
152+
'multi_login' => true,
139153

140154
);

app/models/User.php

+19
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,24 @@ public function scopeGetNotDeleted($query)
119119
return $query->whereNull('deleted_at');
120120
}
121121

122+
/**
123+
* Override the SentryUser getPersistCode method for
124+
* multiple logins at one time
125+
**/
126+
public function getPersistCode()
127+
{
128+
129+
if (!Config::get('session.multi_login') || (!$this->persist_code))
130+
{
131+
$this->persist_code = $this->getRandomString();
132+
133+
// Our code got hashed
134+
$persistCode = $this->persist_code;
135+
$this->save();
136+
return $persistCode;
137+
}
138+
return $this->persist_code;
139+
}
140+
122141

123142
}

0 commit comments

Comments
 (0)