Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
047bf4fa
Commit
047bf4fa
authored
Nov 14, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
93831760
'
* commit '
93831760
': Squashed 'Modules/User/' changes from 95673b5..440ce5c
parents
856b7e77
93831760
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
17 additions
and
133 deletions
+17
-133
.sensiolabs.yml
Modules/User/.sensiolabs.yml
+3
-0
.travis.yml
Modules/User/.travis.yml
+6
-0
UpdateUserRequest.php
Modules/User/Http/Requests/UpdateUserRequest.php
+2
-1
routes.php
Modules/User/Http/routes.php
+5
-3
create.blade.php
Modules/User/Resources/views/admin/roles/create.blade.php
+0
-3
edit.blade.php
Modules/User/Resources/views/admin/roles/edit.blade.php
+0
-3
index.blade.php
Modules/User/Resources/views/admin/roles/index.blade.php
+0
-1
create.blade.php
Modules/User/Resources/views/admin/users/create.blade.php
+0
-3
edit.blade.php
Modules/User/Resources/views/admin/users/edit.blade.php
+0
-3
index.blade.php
Modules/User/Resources/views/admin/users/index.blade.php
+0
-1
SessionUrlTest.php
Modules/User/Tests/SessionUrlTest.php
+0
-50
UserUrlTest.php
Modules/User/Tests/UserUrlTest.php
+0
-65
readme.md
Modules/User/readme.md
+1
-0
No files found.
Modules/User/.sensiolabs.yml
0 → 100644
View file @
047bf4fa
rules
:
php.interface_has_no_interface_suffix
:
enabled
:
false
Modules/User/.travis.yml
0 → 100644
View file @
047bf4fa
language
:
php
php
:
-
5.6
-
5.5
-
5.4
-
hhvm
Modules/User/Http/Requests/UpdateUserRequest.php
View file @
047bf4fa
...
...
@@ -6,8 +6,9 @@ class UpdateUserRequest extends FormRequest
{
public
function
rules
()
{
$userId
=
$this
->
route
()
->
getParameter
(
'users'
);
return
[
'email'
=>
'required|email'
,
'email'
=>
"required|email|unique:users,email,
{
$userId
}
"
,
'first_name'
=>
'required'
,
'last_name'
=>
'required'
,
];
...
...
Modules/User/Http/routes.php
View file @
047bf4fa
<?php
$router
->
group
([
'prefix'
=>
LaravelLocalization
::
setLocale
(),
'before'
=>
'LaravelLocalizationRedirectFilter|auth.admin|permissions'
],
function
(
$router
)
use
Illuminate\Routing\Router
;
$router
->
group
([
'prefix'
=>
LaravelLocalization
::
setLocale
(),
'before'
=>
'LaravelLocalizationRedirectFilter|auth.admin|permissions'
],
function
(
Router
$router
)
{
$router
->
group
([
'prefix'
=>
Config
::
get
(
'core::core.admin-prefix'
),
'namespace'
=>
'Modules\User\Http\Controllers'
],
function
(
$router
)
$router
->
group
([
'prefix'
=>
Config
::
get
(
'core::core.admin-prefix'
),
'namespace'
=>
'Modules\User\Http\Controllers'
],
function
(
Router
$router
)
{
$router
->
resource
(
'users'
,
'Admin\UserController'
,
[
'except'
=>
[
'show'
],
'names'
=>
[
'index'
=>
'dashboard.user.index'
,
...
...
@@ -23,7 +25,7 @@ $router->group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'Larav
});
});
$router
->
group
([
'prefix'
=>
'auth'
,
'namespace'
=>
'Modules\User\Http\Controllers'
],
function
(
$router
)
$router
->
group
([
'prefix'
=>
'auth'
,
'namespace'
=>
'Modules\User\Http\Controllers'
],
function
(
Router
$router
)
{
# Login
$router
->
get
(
'login'
,
[
'before'
=>
'auth.guest'
,
'as'
=>
'login'
,
'uses'
=>
'AuthController@getLogin'
]);
...
...
Modules/User/Resources/views/admin/roles/create.blade.php
View file @
047bf4fa
...
...
@@ -25,9 +25,6 @@
<
div
class
="
tab
-
content
">
<div class="
tab
-
pane
active
" id="
tab_1
-
1
">
<div class="
box
-
body
">
<div class="
row
">
@include('flash::message')
</div>
<div class="
row
">
<div class="
col
-
sm
-
6
">
<div class="
form
-
group
{{
$errors
->
has
(
'name'
)
?
' has-error'
:
''
}}
">
...
...
Modules/User/Resources/views/admin/roles/edit.blade.php
View file @
047bf4fa
...
...
@@ -28,9 +28,6 @@
<
div
class
="
tab
-
content
">
<div class="
tab
-
pane
active
" id="
tab_1
-
1
">
<div class="
box
-
body
">
<div class="
row
">
@include('flash::message')
</div>
<div class="
row
">
<div class="
col
-
sm
-
6
">
<div class="
form
-
group
{{
$errors
->
has
(
'name'
)
?
' has-error'
:
''
}}
">
...
...
Modules/User/Resources/views/admin/roles/index.blade.php
View file @
047bf4fa
...
...
@@ -14,7 +14,6 @@
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<div
class=
"row"
>
@include('flash::message')
<div
class=
"btn-group pull-right"
style=
"margin: 0 15px 15px 0;"
>
<a
href=
"{{ URL::route('dashboard.role.create') }}"
class=
"btn btn-primary btn-flat"
style=
"padding: 4px 10px;"
>
<i
class=
"fa fa-pencil"
></i>
{{ trans('user::roles.button.new-role') }}
...
...
Modules/User/Resources/views/admin/users/create.blade.php
View file @
047bf4fa
...
...
@@ -28,9 +28,6 @@
<
div
class
="
tab
-
content
">
<div class="
tab
-
pane
active
" id="
tab_1
-
1
">
<div class="
box
-
body
">
<div class="
row
">
@include('flash::message')
</div>
<div class="
row
">
<div class="
col
-
sm
-
4
">
<div class="
form
-
group
{{
$errors
->
has
(
'first_name'
)
?
' has-error'
:
''
}}
">
...
...
Modules/User/Resources/views/admin/users/edit.blade.php
View file @
047bf4fa
...
...
@@ -28,9 +28,6 @@
<
div
class
="
tab
-
content
">
<div class="
tab
-
pane
active
" id="
tab_1
-
1
">
<div class="
box
-
body
">
<div class="
row
">
@include('flash::message')
</div>
<div class="
row
">
<div class="
col
-
sm
-
4
">
<div class="
form
-
group
{{
$errors
->
has
(
'first_name'
)
?
' has-error'
:
''
}}
">
...
...
Modules/User/Resources/views/admin/users/index.blade.php
View file @
047bf4fa
...
...
@@ -14,7 +14,6 @@
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<div
class=
"row"
>
@include('flash::message')
<div
class=
"btn-group pull-right"
style=
"margin: 0 15px 15px 0;"
>
<a
href=
"{{ URL::route('dashboard.user.create') }}"
class=
"btn btn-primary btn-flat"
style=
"padding: 4px 10px;"
>
<i
class=
"fa fa-pencil"
></i>
{{ trans('user::users.button.new-user') }}
...
...
Modules/User/Tests/SessionUrlTest.php
deleted
100644 → 0
View file @
856b7e77
<?php
namespace
Modules\User\Tests
;
use
Cartalyst\Sentinel\Laravel\Facades\Sentinel
;
use
Illuminate\Support\Facades\Config
;
use
Modules\Core\Tests\BaseTestCase
;
class
SessionUrlTest
extends
BaseTestCase
{
/** @test */
public
function
loginPageShouldBeAccessible
()
{
$this
->
checkResponseIsOkAndContains
([
'GET'
,
'/auth/login'
],
'.header:contains("Sign In")'
);
}
/** @test */
public
function
registerPageShouldBeAccessible
()
{
$this
->
checkResponseIsOkAndContains
([
'GET'
,
'/auth/register'
],
'.header:contains("Register New Membership")'
);
}
/** @test */
public
function
forgotPasswordShouldBeAccessible
()
{
$this
->
checkResponseIsOkAndContains
([
'GET'
,
'/auth/reset'
],
'.header:contains("Reset Password")'
);
}
/** @test */
public
function
dashboardShouldNotBePubliclyAccessible
()
{
$this
->
app
[
'router'
]
->
enableFilters
();
Sentinel
::
logout
();
$this
->
client
->
request
(
'GET'
,
'/'
.
Config
::
get
(
'core::core.admin-prefix'
));
$this
->
assertRedirectedTo
(
'auth/login'
);
}
/** @test */
public
function
dashboardShouldBeAccessibleIfLoggedIn
()
{
// $sentinelMock = Mockery::mock('Cartalyst\Sentinel\Laravel\Facades\Sentinel');
// $sentinelMock->shouldReceive('check')->andReturn(true);
$this
->
app
[
'router'
]
->
enableFilters
();
$user
=
Sentinel
::
findById
(
4
);
Sentinel
::
login
(
$user
);
$this
->
checkResponseIsOkAndContains
([
'GET'
,
'/'
.
Config
::
get
(
'core::core.admin-prefix'
)],
'h1:contains("Dashboard")'
);
}
}
Modules/User/Tests/UserUrlTest.php
deleted
100644 → 0
View file @
856b7e77
<?php
namespace
Modules\User\Tests
;
use
Cartalyst\Sentinel\Laravel\Facades\Sentinel
;
use
Illuminate\Support\Facades\Config
;
use
Modules\Core\Tests\BaseTestCase
;
class
UserUrlTest
extends
BaseTestCase
{
public
function
setUp
()
{
parent
::
setUp
();
$user
=
Sentinel
::
findById
(
4
);
Sentinel
::
login
(
$user
);
}
/** @test */
public
function
userIndexShouldBeAccessible
()
{
$uri
=
'/'
.
Config
::
get
(
'core::core.admin-prefix'
)
.
'/users'
;
$this
->
checkResponseIsOkAndContains
([
'GET'
,
$uri
],
'h1:contains("Users")'
);
}
/** @test */
public
function
userEditShouldBeAccessible
()
{
$uri
=
'/'
.
Config
::
get
(
'core::core.admin-prefix'
)
.
'/users/4/edit'
;
$this
->
checkResponseIsOkAndContains
([
'GET'
,
$uri
],
'h1:contains("Edit User")'
);
}
/** @test */
public
function
userCreateShouldBeAccessible
()
{
$uri
=
'/'
.
Config
::
get
(
'core::core.admin-prefix'
)
.
'/users/create'
;
$this
->
checkResponseIsOkAndContains
([
'GET'
,
$uri
],
'h1:contains("New User")'
);
}
/** @test */
public
function
roleIndexShouldBeAccessible
()
{
$uri
=
'/'
.
Config
::
get
(
'core::core.admin-prefix'
)
.
'/roles'
;
$this
->
checkResponseIsOkAndContains
([
'GET'
,
$uri
],
'h1:contains("Roles")'
);
}
/** @test */
public
function
roleCreateShouldBeAccessible
()
{
$uri
=
'/'
.
Config
::
get
(
'core::core.admin-prefix'
)
.
'/roles/create'
;
$this
->
checkResponseIsOkAndContains
([
'GET'
,
$uri
],
'h1:contains("New Role")'
);
}
/** @test */
public
function
roleEditShouldBeAccessible
()
{
$uri
=
'/'
.
Config
::
get
(
'core::core.admin-prefix'
)
.
'/roles/6/edit'
;
$this
->
checkResponseIsOkAndContains
([
'GET'
,
$uri
],
'h1:contains("Updating Role")'
);
}
}
Modules/User/readme.md
View file @
047bf4fa
...
...
@@ -2,6 +2,7 @@
[
![SensioLabsInsight
](
https://insight.sensiolabs.com/projects/304d1d01-3347-4958-915f-b2daabfe5f5a/mini.png
)
](https://insight.sensiolabs.com/projects/304d1d01-3347-4958-915f-b2daabfe5f5a)
[
![Scrutinizer Code Quality
](
https://scrutinizer-ci.com/g/nWidart-Modules/User/badges/quality-score.png?b=master
)
](https://scrutinizer-ci.com/g/nWidart-Modules/User/?branch=master)
[
![Code Climate
](
https://codeclimate.com/github/nWidart-Modules/User/badges/gpa.svg
)
](https://codeclimate.com/github/nWidart-Modules/User)
This module is responsible for handling the users and roles.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment