Skip to content

Commit f9371f1

Browse files
committed
Add Sentry bundle and modify bundle.php for this
1 parent 682786a commit f9371f1

21 files changed

+4001
-2
lines changed

application/bundles.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
return array(
3737

38-
'docs' => array('handles' => 'docs'),
38+
'docs' => array('handles' => 'docs'),
39+
'sentry' => array('auto'=> true)
3940

40-
);
41+
);

bundles/sentry/config/sentry.php

+211
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
<?php
2+
/**
3+
* Part of the Sentry bundle for Laravel.
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* Licensed under the 3-clause BSD License.
8+
*
9+
* This source file is subject to the 3-clause BSD License that is
10+
* bundled with this package in the LICENSE file. It is also available at
11+
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
12+
*
13+
* @package Sentry
14+
* @version 1.0
15+
* @author Cartalyst LLC
16+
* @license BSD License (3-clause)
17+
* @copyright (c) 2011 - 2012, Cartalyst LLC
18+
* @link http://cartalyst.com
19+
*/
20+
21+
return array(
22+
23+
/**
24+
* Database instance to use
25+
* Leave this null to use the default 'active' db instance
26+
* To use any other instance, set this to any instance that's defined in APPPATH/config/db.php
27+
*/
28+
'db_instance' => null,
29+
30+
/*
31+
* Table Names
32+
*/
33+
'table' => array(
34+
'users' => 'users',
35+
'groups' => 'groups',
36+
'users_groups' => 'users_groups',
37+
'users_metadata' => 'users_metadata',
38+
'users_suspended' => 'users_suspended',
39+
'rules' => 'rules',
40+
),
41+
42+
/*
43+
* Session keys
44+
*/
45+
'session' => array(
46+
'user' => 'sentry_user',
47+
'provider' => 'sentry_provider',
48+
),
49+
50+
/*
51+
* Default Authorization Column - username or email
52+
*/
53+
'login_column' => 'email',
54+
55+
/*
56+
* Remember Me settings
57+
*/
58+
'remember_me' => array(
59+
60+
/**
61+
* Cookie name credentials are stored in
62+
*/
63+
'cookie_name' => 'sentry_rm',
64+
65+
/**
66+
* How long the cookie should last. (seconds)
67+
*/
68+
'expire' => 20160, // 2 weeks - minutes
69+
),
70+
71+
/**
72+
* Limit Number of Failed Attempts
73+
* Suspends a login/ip combo after a # of failed attempts for a set amount of time
74+
*/
75+
'limit' => array(
76+
77+
/**
78+
* enable limit - true/false
79+
*/
80+
'enabled' => true,
81+
82+
/**
83+
* number of attempts before suspensions
84+
*/
85+
'attempts' => 5,
86+
87+
/**
88+
* suspension length - minutes
89+
*/
90+
'time' => 15,
91+
),
92+
93+
/**
94+
* Password Hashing
95+
* Sets hashing strategies for passwords
96+
* Note: you may have to adjust all password related fields in the database depending on the password hash length
97+
*/
98+
'hash' => array(
99+
100+
/**
101+
* Strategy to use
102+
* look into classes/sentry/hash/strategy for available strategies ( or make/import your own )
103+
* Must be in strategies below
104+
*/
105+
'strategy' => 'Sentry',
106+
107+
/**
108+
* Convert hashes from another available strategy
109+
*/
110+
'convert' => array(
111+
'enabled' => false,
112+
'from' => '',
113+
),
114+
115+
/**
116+
* Available Strategies for your app
117+
* This is used to set settings for conversion, like switching from SimpleAuth hashing to Sha256 or vice versa
118+
*/
119+
'strategies' => array(
120+
/**
121+
* config options needed for hashing
122+
* example:
123+
* 'Strategy' => array(); // additional options needed for password hashing in your driver like a configurable salt
124+
*/
125+
126+
'Sentry' => array(),
127+
128+
'Oscommerce' => array(
129+
'salt' => '',
130+
),
131+
132+
'BCrypt' => array(
133+
'strength' => 4,
134+
// if you want to use a bcrypt hash with an algorithm
135+
'hashing_algorithm' => null,
136+
),
137+
),
138+
),
139+
140+
'permissions' => array(
141+
142+
/**
143+
* enable permissions - true or false
144+
*/
145+
'enabled' => true,
146+
147+
/**
148+
* super user - string
149+
* this will be used for the group and rules
150+
* if you change this, you need to make sure you change the
151+
*/
152+
'superuser' => 'superuser',
153+
154+
/**
155+
* Source of defined rules
156+
* Possible choices: file / database.
157+
* If file is chosen it reads the rules from config/sentry.php's permissions->rules array
158+
* If database is chosen it reads the rules from the rules table defined in the table array
159+
*
160+
*/
161+
'rules_source' => 'file',
162+
163+
/**
164+
* The permission rules file
165+
* Must return an array with a 'rules' key.
166+
*/
167+
'file' => array(
168+
/**
169+
* Type options: config | php
170+
*
171+
* name and path are ignored if type is config
172+
* - name will be permissions
173+
* - path will be the bundles config folder
174+
*
175+
* name and path are required if type is php
176+
* - name will be the file name of the php file
177+
* - path will be relative to the current bundles base folder
178+
*/
179+
'type' => 'php',
180+
'name' => 'extension',
181+
'path' => '',
182+
),
183+
184+
/**
185+
* !Ignored if database is selected instead of file!
186+
*
187+
* setup rules for permissions
188+
* These are resources that will require access permissions.
189+
* Rules are assigned to groups or specific users in the
190+
* format bundle::controller@method
191+
*
192+
* This is always used for global permissions
193+
*/
194+
'rules' => array(
195+
/**
196+
* config samples.
197+
*
198+
* 'application::admin@dashboard',
199+
* 'user::admin@create',
200+
* 'user::admin@read',
201+
* 'blog::admin@delete',
202+
* 'my_custom_rule',
203+
* 'is_admin',
204+
*/
205+
'is_admin',
206+
'superuser',
207+
),
208+
209+
),
210+
211+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
return array(
4+
'_title_' => 'Global',
5+
'is_admin' => 'Admin Access',
6+
'superuser' => 'Super User'
7+
);

bundles/sentry/language/en/sentry.php

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/**
3+
* Part of the Sentry bundle for Laravel.
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* Licensed under the 3-clause BSD License.
8+
*
9+
* This source file is subject to the 3-clause BSD License that is
10+
* bundled with this package in the LICENSE file. It is also available at
11+
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
12+
*
13+
* @package Sentry
14+
* @version 1.0
15+
* @author Cartalyst LLC
16+
* @license BSD License (3-clause)
17+
* @copyright (c) 2011 - 2012, Cartalyst LLC
18+
* @link http://cartalyst.com
19+
*/
20+
21+
return array(
22+
23+
/** General Exception Messages **/
24+
'account_not_activated' => 'User has not activated their account.',
25+
'account_is_disabled' => 'This account has been disabled.',
26+
'invalid_limit_attempts' => 'Sentry Config Item: "limit.attempts" must be an integer greater than 0',
27+
'invalid_limit_time' => 'Sentry Config Item: "limit.time" must be an integer greater than 0',
28+
'login_column_empty' => 'You must set "login_column" in the Sentry config.',
29+
30+
/** Group Exception Messages **/
31+
'group_already_exists' => 'The group name ":group" already exists.',
32+
'group_level_empty' => 'You must specify a level of the group.',
33+
'group_name_empty' => 'You must specify a name of the group.',
34+
'group_not_found' => 'Group ":group" does not exist.',
35+
'invalid_group_id' => 'Group ID must be a valid integer greater than 0.',
36+
'not_found_in_group_object' => '":field" does not exist in "group" object.',
37+
'no_group_selected' => 'No group is selected to get from.',
38+
'user_already_in_group' => 'The User is already in group ":group".',
39+
'user_not_in_group' => 'The User is not in group ":group".',
40+
41+
/** User Exception Messages **/
42+
'column_already_exists' => 'That :column already exists.',
43+
'column_and_password_empty' => ':column and Password can not be empty.',
44+
'column_email_and_password_empty' => ':column, Email and Password can not be empty.',
45+
'column_is_empty' => ':column must not be empty.',
46+
'email_already_in_use' => 'That email is already in use.',
47+
'invalid_old_password' => 'Old password is invalid',
48+
'invalid_user_id' => 'User ID must be a valid integer greater than 0.',
49+
'no_user_selected' => 'You must first select a user.',
50+
'no_user_selected_to_delete' => 'No user is selected to delete.',
51+
'no_user_selected_to_get' => 'No user is selected to get.',
52+
'not_found_in_user_object' => '":field" does not exist in "user" object.',
53+
'password_empty' => 'Password can not be empty.',
54+
'user_already_enabled' => 'The user is already enabled',
55+
'user_already_disabled' => 'The user is already disabled',
56+
'user_not_found' => 'The user does not exist.',
57+
'username_already_in_use' => 'That username is already in use.',
58+
59+
/** Attempts Exception Messages **/
60+
'login_ip_required' => 'Login Id and IP Adress are required to add a login attempt.',
61+
'single_user_required' => 'Attempts can only be added to a single user, an array was given.',
62+
'user_suspended' => 'You have been suspended from trying to login into account ":account" for :time minutes.',
63+
64+
/** Hashing **/
65+
'hash_strategy_null' => 'Hashing strategy is null or empty. A hashing strategy must be set.',
66+
'hash_strategy_not_exist' => 'Hashing strategy file does not exist.',
67+
68+
/** Permissions Messages **/
69+
'no_rules_added' => 'Oops, you forgot to specify any rules to be added.',
70+
'rule_not_found' => 'The rule :rule, does not exist in your configured rules. Please check your rules in the sentry config.',
71+
'permission_denied' => 'Oops, you do not have permission to access :resource',
72+
73+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
return array(
4+
'_title_' => 'Global',
5+
'is_admin' => 'Admin hozzáférés',
6+
'superuser' => 'Super User'
7+
);

bundles/sentry/language/hu/sentry.php

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/**
3+
* Part of the Sentry bundle for Laravel.
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* Licensed under the 3-clause BSD License.
8+
*
9+
* This source file is subject to the 3-clause BSD License that is
10+
* bundled with this package in the LICENSE file. It is also available at
11+
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
12+
*
13+
* @package Sentry
14+
* @version 1.0
15+
* @author Cartalyst LLC
16+
* @license BSD License (3-clause)
17+
* @copyright (c) 2011 - 2012, Cartalyst LLC
18+
* @link http://cartalyst.com
19+
*/
20+
21+
return array(
22+
23+
/** General Exception Messages **/
24+
'account_not_activated' => 'A felhasználó még nem aktiválta a fiókját.',
25+
'account_is_disabled' => 'Ez a fiók ki lett kapcsolva.',
26+
'invalid_limit_attempts' => 'A "limit.attempts" Sentry beállításnak 0-nál nagyobb számnak kell lennie',
27+
'invalid_limit_time' => 'A "limit.time" Sentry beállításnak egy 0-nál nagyobb számnak kell lennie',
28+
'login_column_empty' => 'Be kell állítanod a "login_column" értékét a Sentry konfigurációban.',
29+
30+
/** Group Exception Messages **/
31+
'group_already_exists' => 'A ":group" nevű csoport már létezik.',
32+
'group_level_empty' => 'Meg kell adnod a csoport szintjét.',
33+
'group_name_empty' => 'El kell nevezned a csoportot.',
34+
'group_not_found' => 'A ":group" nevű csoport nem létezik.',
35+
'invalid_group_id' => 'A Group ID 0-nál nagyobb szám kell legyen.',
36+
'not_found_in_group_object' => 'A ":field" mező nem létezik a "group" objektumban.',
37+
'no_group_selected' => 'Nincs csoport kiválasztva.',
38+
'user_already_in_group' => 'A felhasználó már a(z) ":group" csoport tagja.',
39+
'user_not_in_group' => 'A felhasználó nem tagja a(z) ":group" csoportnak.',
40+
41+
/** User Exception Messages **/
42+
'column_already_exists' => 'A(z) :column már létezik.',
43+
'column_and_password_empty' => 'A(z) :column és a jelszó nem hiányozhat.',
44+
'column_email_and_password_empty' => 'A(z) :column, Email és a Jelszó nem lehet hiányozhat.',
45+
'column_is_empty' => ':column nem lehet üres.',
46+
'email_already_in_use' => 'A megadott email fiók már használatban van.',
47+
'invalid_old_password' => 'A régi jelszó nem megfelelő',
48+
'invalid_user_id' => 'A User ID 0-nál nagyobb szám kell legyen.',
49+
'no_user_selected' => 'Először ki kell választanod egy felhasználót.',
50+
'no_user_selected_to_delete' => 'Nincs kiválasztva felhasználó a törlésre.',
51+
'no_user_selected_to_get' => 'Nem található a keresett felhasználó .',
52+
'not_found_in_user_object' => 'A(z) ":field" mező nem létezik a "user" objektumban.',
53+
'password_empty' => 'A jelszó nem maradhat üresen.',
54+
'user_already_enabled' => 'A fiók már aktiválva van',
55+
'user_already_disabled' => 'A felhasználó már ki van tiltva',
56+
'user_not_found' => 'A felhasználó nem létezik.',
57+
'username_already_in_use' => 'A megadott felhasználónév már foglalt.',
58+
59+
/** Attempts Exception Messages **/
60+
'login_ip_required' => 'Belépési azonosító és IP cím szükséges a belépési kísérlet hozzáadásához.',
61+
'single_user_required' => 'Próbálkozás csak egy felhasználóhoz rendelődhet, tömb került feldolgozásra.',
62+
'user_suspended' => 'Fel lettél függesztve a bejelentkezések alól a ":account" fióktól :time percig.',
63+
64+
/** Hashing **/
65+
'hash_strategy_null' => 'A Hashelési stratégia üres, vagy null. Kötelező egy stratégia kiválasztása.',
66+
'hash_strategy_not_exist' => 'Nem található a hashelési stratégiához tartozó file.',
67+
68+
/** Permissions Messages **/
69+
'no_rules_added' => 'Hoppá, elfelejtettél megadni szabályt.',
70+
'rule_not_found' => 'A :rule szabály nincs a definiált szabályok közt. Kérlek ellenőrizd a beállítások a Sentry konfigurációs file-jában.',
71+
'permission_denied' => 'Nincs jogosoltságod hozzáférni a :resource -hoz',
72+
73+
);

0 commit comments

Comments
 (0)