Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
e-epal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
af1f9efc
Commit
af1f9efc
authored
Apr 28, 2017
by
Open Source Developer
Browse files
Options
Browse Files
Download
Plain Diff
trans
parents
5f6e1b24
ecf690c8
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
79 additions
and
42 deletions
+79
-42
drupal/modules/casost/src/Controller/CASLogin.php
drupal/modules/casost/src/Controller/CASLogin.php
+4
-4
source/actions/criteria.actions.ts
source/actions/criteria.actions.ts
+9
-1
source/actions/epalclass.actions.ts
source/actions/epalclass.actions.ts
+9
-5
source/actions/studentdatafields.actions.ts
source/actions/studentdatafields.actions.ts
+9
-1
source/app.settings.ts
source/app.settings.ts
+1
-0
source/components/navbar/navbar.component.html
source/components/navbar/navbar.component.html
+1
-1
source/components/navbar/navbar.component.ts
source/components/navbar/navbar.component.ts
+29
-6
source/components/student-application-form/epal.class.select.ts
.../components/student-application-form/epal.class.select.ts
+0
-9
source/constants.ts
source/constants.ts
+3
-1
source/services/helper-data-service.ts
source/services/helper-data-service.ts
+4
-4
source/store/criteria/criteria.reducer.ts
source/store/criteria/criteria.reducer.ts
+4
-1
source/store/epalclasses/epalclasses.reducer.ts
source/store/epalclasses/epalclasses.reducer.ts
+3
-4
source/store/studentdatafields/studentdatafields.reducer.ts
source/store/studentdatafields/studentdatafields.reducer.ts
+3
-5
No files found.
drupal/modules/casost/src/Controller/CASLogin.php
View file @
af1f9efc
...
...
@@ -124,10 +124,10 @@ class CASLogin extends ControllerBase
return
$response
;
}
$attributes
=
phpCAS
::
getAttributes
();
foreach
(
$attributes
as
$attr_key
=>
$attr_value
)
{
/*
foreach ($attributes as $attr_key => $attr_value) {
$this->logger->warning($attr_key);
$this->logger->warning(phpCAS::getAttribute($attr_key));
}
}
*/
/* $isAllowed = true;
$att1 = $attributes[$this->allowed1];
...
...
@@ -207,7 +207,7 @@ class CASLogin extends ControllerBase
// return new RedirectResponse($this->redirectUrl, 302, $headers);
}
else
{
$response
=
new
Response
();
$response
->
setContent
(
'
forbidde
n'
);
$response
->
setContent
(
'
No proper authenticatio
n'
);
$response
->
setStatusCode
(
Response
::
HTTP_FORBIDDEN
);
$response
->
headers
->
set
(
'Content-Type'
,
'application/json'
);
return
$response
;
...
...
@@ -216,7 +216,7 @@ class CASLogin extends ControllerBase
}
catch
(
\
Exception
$e
)
{
$this
->
logger
->
warning
(
$e
->
getMessage
());
$response
=
new
Response
();
$response
->
setContent
(
'
forbidden
'
);
$response
->
setContent
(
'
Unexpected Problem
'
);
$response
->
setStatusCode
(
Response
::
HTTP_FORBIDDEN
);
$response
->
headers
->
set
(
'Content-Type'
,
'application/json'
);
return
$response
;
...
...
source/actions/criteria.actions.ts
View file @
af1f9efc
import
{
CRITERIA_RECEIVED
,
CRITERIA_SAVE
}
from
'
../constants
'
;
import
{
CRITERIA_RECEIVED
,
CRITERIA_SAVE
,
CRITERIA_INIT
}
from
'
../constants
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
NgRedux
}
from
'
ng2-redux
'
;
import
{
IAppState
}
from
'
../store
'
;
...
...
@@ -34,4 +34,12 @@ export class CriteriaActions {
});
};
initCriteria
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
CRITERIA_INIT
,
payload
:
{
}
});
};
}
source/actions/epalclass.actions.ts
View file @
af1f9efc
import
{
EPALCLASSES_SAVE
}
from
'
../constants
'
;
import
{
EPALCLASSES_INIT
}
from
'
../constants
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
NgRedux
}
from
'
ng2-redux
'
;
import
{
IAppState
}
from
'
../store
'
;
...
...
@@ -19,9 +20,12 @@ export class EpalClassesActions {
});
};
}
initEpalClasses
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
EPALCLASSES_INIT
,
payload
:
{
}
});
};
}
source/actions/studentdatafields.actions.ts
View file @
af1f9efc
import
{
STUDENTDATAFIELDS_SAVE
,
STUDENTDATAFIELDS_
RECEIVED
}
from
'
../constants
'
;
import
{
STUDENTDATAFIELDS_SAVE
,
STUDENTDATAFIELDS_
INIT
}
from
'
../constants
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
NgRedux
}
from
'
ng2-redux
'
;
import
{
IAppState
}
from
'
../store
'
;
...
...
@@ -22,4 +22,12 @@ export class StudentDataFieldsActions {
};
initStudentDataFields
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
STUDENTDATAFIELDS_INIT
,
payload
:
{
}
});
};
}
source/app.settings.ts
View file @
af1f9efc
// export const API_ENDPOINT = 'http://eduslim2.minedu.gov.gr/drupal';
export
const
API_ENDPOINT
=
'
http://eduslim2.minedu.gov.gr/angular/eepal-front/drupal
'
;
export
class
AppSettings
{
...
...
source/components/navbar/navbar.component.html
View file @
af1f9efc
...
...
@@ -15,7 +15,7 @@
<button
type=
"button"
class=
"btn-primary btn-sm pull-right"
(click)=
"
oauthS
ignOut()"
>
<button
type=
"button"
class=
"btn-primary btn-sm pull-right"
(click)=
"
s
ignOut()"
>
<i
class=
"fa fa-sign-out"
></i>
</button>
</div>
...
...
source/components/navbar/navbar.component.ts
View file @
af1f9efc
...
...
@@ -9,8 +9,13 @@ import { ILoginInfo, ILoginInfoToken } from '../../store/logininfo/logininfo.typ
import
{
HelperDataService
}
from
'
../../services/helper-data-service
'
;
import
{
LoginInfoActions
}
from
'
../../actions/logininfo.actions
'
;
import
{
LOGININFO_INITIAL_STATE
}
from
'
../../store/logininfo/logininfo.initial-state
'
;
import
{
SCHOOL_ROLE
,
STUDENT_ROLE
,
PDE_ROLE
,
DIDE_ROLE
,
MINISTRY_ROLE
}
from
'
../../constants
'
;
import
{
EpalClassesActions
}
from
'
../../actions/epalclass.actions
'
;
import
{
SectorFieldsActions
}
from
'
../../actions/sectorfields.actions
'
;
import
{
RegionSchoolsActions
}
from
'
../../actions/regionschools.actions
'
;
import
{
SectorCoursesActions
}
from
'
../../actions/sectorcourses.actions
'
;
import
{
CriteriaActions
}
from
'
../../actions/criteria.actions
'
;
import
{
StudentDataFieldsActions
}
from
'
../../actions/studentdatafields.actions
'
;
@
Component
({
selector
:
'
reg-navbar
'
,
...
...
@@ -26,6 +31,12 @@ import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial
constructor
(
private
_ata
:
LoginInfoActions
,
private
_hds
:
HelperDataService
,
private
_csa
:
SectorCoursesActions
,
private
_sfa
:
SectorFieldsActions
,
private
_rsa
:
RegionSchoolsActions
,
private
_eca
:
EpalClassesActions
,
private
_sdfa
:
StudentDataFieldsActions
,
private
_cria
:
CriteriaActions
,
private
_ngRedux
:
NgRedux
<
IAppState
>
,
private
router
:
Router
)
{
...
...
@@ -58,16 +69,28 @@ import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial
}
oauthS
ignOut
()
{
s
ignOut
()
{
this
.
_hds
.
signOut
().
then
(
data
=>
{
this
.
_ata
.
initLoginInfo
();
if
(
this
.
authRole
===
'
director
'
)
{
if
(
this
.
authRole
===
SCHOOL_ROLE
)
{
this
.
router
.
navigate
([
'
/school
'
]);
}
else
if
(
this
.
authRole
===
PDE_ROLE
)
{
this
.
router
.
navigate
([
'
/school
'
]);
}
else
if
(
this
.
authRole
===
DIDE_ROLE
)
{
this
.
router
.
navigate
([
'
/school
'
]);
}
else
if
(
this
.
authRole
===
'
student
'
)
{
else
if
(
this
.
authRole
===
STUDENT_ROLE
)
{
this
.
_eca
.
initEpalClasses
();
this
.
_sfa
.
initSectorFields
();
this
.
_rsa
.
initRegionSchools
();
this
.
_csa
.
initSectorCourses
();
this
.
_sdfa
.
initStudentDataFields
();
this
.
_cria
.
initCriteria
();
this
.
router
.
navigate
([
''
]);
}
else
if
(
this
.
authRole
===
'
supervisor
'
)
{
else
if
(
this
.
authRole
===
MINISTRY_ROLE
)
{
this
.
router
.
navigate
([
'
/ministry
'
]);
}
this
.
authToken
=
''
;
...
...
source/components/student-application-form/epal.class.select.ts
View file @
af1f9efc
...
...
@@ -106,15 +106,6 @@ import {AppSettings} from '../../app.settings';
this
.
_sfa
.
initSectorFields
();
this
.
_rsa
.
initRegionSchools
();
this
.
_csa
.
initSectorCourses
();
/* this._sfa.getSectorFields(true);
this._rsa.getRegionSchools(1,"-1", true);
console.log("Here I am!");
//this._rsa.saveRegionSchoolsOrder(true);
this._csa.getSectorCourses(true);
this._csa.getSectorCourses(true); */
}
}
source/constants.ts
View file @
af1f9efc
...
...
@@ -14,10 +14,11 @@ export const SECTORCOURSES_RECEIVED = 'SECTORCOURSES_RECEIVED';
export
const
SECTORCOURSES_SELECTED_SAVE
=
'
SECTORCOURSES_SELECTED_SAVE
'
;
export
const
SECTORCOURSES_INIT
=
'
SECTORCOURSES_INIT
'
;
export
const
STUDENTDATAFIELDS_RECEIVED
=
'
STUDENTDATAFIELDS_RECEIVED
'
;
export
const
STUDENTDATAFIELDS_SAVE
=
'
STUDENTDATAFIELDS_SAVE
'
;
export
const
STUDENTDATAFIELDS_INIT
=
'
STUDENTDATAFIELDS_INIT
'
;
export
const
EPALCLASSES_SAVE
=
'
EPALCLASSES_SAVE
'
;
export
const
EPALCLASSES_INIT
=
'
EPALCLASSES_INIT
'
;
export
const
LOGININFO_SAVE
=
'
LOGININFO_SAVE
'
;
...
...
@@ -30,6 +31,7 @@ export const LOGININFO_INIT = 'LOGININFO_INIT';
export
const
CRITERIA_RECEIVED
=
'
CRITERIA_RECEIVED
'
;
export
const
CRITERIA_SAVE
=
'
CRITERIA_SAVE
'
;
export
const
CRITERIA_INIT
=
'
CRITERIA_INIT
'
;
//export const VALID_NAMES_PATTERN = '[Α-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$';
export
const
VALID_NAMES_PATTERN
=
'
[A-Za-zΑ-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$
'
;
...
...
source/services/helper-data-service.ts
View file @
af1f9efc
...
...
@@ -12,7 +12,7 @@ import { NgRedux, select } from 'ng2-redux';
import
{
IAppState
}
from
'
../store/store
'
;
import
{
ILoginInfo
,
ILoginInfoToken
}
from
'
../store/logininfo/logininfo.types
'
;
import
{
LOGININFO_INITIAL_STATE
}
from
'
../store/logininfo/logininfo.initial-state
'
;
import
{
SCHOOL_ROLE
,
STUDENT_ROLE
,
PDE_ROLE
,
DIDE_ROLE
,
MINISTRY_ROLE
}
from
'
../constants
'
;
const
HEADER
=
{
headers
:
new
Headers
({
'
Content-Type
'
:
'
application/json
'
})
};
...
...
@@ -428,15 +428,15 @@ export class HelperDataService implements OnInit, OnDestroy {
// "X-Auth-Token": this.authToken
});
if
(
this
.
authRole
===
"
supervisor
"
)
if
(
this
.
authRole
===
MINISTRY_ROLE
)
this
.
createMinistryAuthorizationHeader
(
headers
,
this
.
minedu_userName
,
this
.
minedu_userPassword
);
else
this
.
createAuthorizationHeader
(
headers
);
let
options
=
new
RequestOptions
({
headers
:
headers
,
withCredentials
:
true
});
let
logoutRoute
=
'
/oauth/logout
'
;
if
(
this
.
authRole
===
'
director
'
)
if
(
this
.
authRole
===
SCHOOL_ROLE
||
this
.
authRole
===
PDE_ROLE
||
this
.
authRole
===
DIDE_ROLE
)
logoutRoute
=
'
/cas/logout
'
;
else
if
(
this
.
authRole
===
'
supervisor
'
)
else
if
(
this
.
authRole
===
MINISTRY_ROLE
)
logoutRoute
=
'
/ministry/logout
'
;
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
source/store/criteria/criteria.reducer.ts
View file @
af1f9efc
...
...
@@ -4,7 +4,8 @@ import { Seq } from 'immutable';
import
{
CRITERIA_RECEIVED
,
CRITERIA_SAVE
CRITERIA_SAVE
,
CRITERIA_INIT
}
from
'
../../constants
'
;
export
function
criteriaReducer
(
state
:
ICriter
=
CRITERIA_INITIAL_STATE
,
action
):
ICriter
{
...
...
@@ -29,6 +30,8 @@ export function criteriaReducer(state: ICriter = CRITERIA_INITIAL_STATE, action)
});
return
Seq
(
criter
).
map
(
n
=>
n
).
toList
();
case
CRITERIA_INIT
:
return
CRITERIA_INITIAL_STATE
;
default
:
return
state
;
}
};
...
...
source/store/epalclasses/epalclasses.reducer.ts
View file @
af1f9efc
...
...
@@ -2,7 +2,7 @@ import { IEpalClasses, IEpalClass } from './epalclasses.types';
import
{
EPALCLASSES_INITIAL_STATE
}
from
'
./epalclasses.initial-state
'
;
import
{
Seq
}
from
'
immutable
'
;
import
{
EPALCLASSES_SAVE
}
from
'
../../constants
'
;
import
{
EPALCLASSES_SAVE
,
EPALCLASSES_INIT
}
from
'
../../constants
'
;
export
function
epalclassesReducer
(
state
:
IEpalClasses
=
EPALCLASSES_INITIAL_STATE
,
action
):
IEpalClasses
{
...
...
@@ -12,11 +12,10 @@ export function epalclassesReducer(state: IEpalClasses = EPALCLASSES_INITIAL_STA
case
EPALCLASSES_SAVE
:
let
selectedEpalClasses
=
Array
<
IEpalClass
>
();
selectedEpalClasses
.
push
(
<
IEpalClass
>
{
name
:
action
.
payload
.
epalClasses
.
name
});
return
Seq
(
selectedEpalClasses
).
map
(
n
=>
n
).
toList
();
case
EPALCLASSES_INIT
:
return
EPALCLASSES_INITIAL_STATE
;
default
:
return
state
;
}
};
source/store/studentdatafields/studentdatafields.reducer.ts
View file @
af1f9efc
import
{
IStudentDataFields
,
IStudentDataField
}
from
'
./studentdatafields.types
'
;
import
{
STUDENT_DATA_FIELDS_INITIAL_STATE
}
from
'
./studentdatafields.initial-state
'
;
import
{
Seq
}
from
'
immutable
'
;
import
{
STUDENTDATAFIELDS_RECEIVED
,
STUDENTDATAFIELDS_SAVE
}
from
'
../../constants
'
;
import
{
STUDENTDATAFIELDS_SAVE
,
STUDENTDATAFIELDS_INIT
}
from
'
../../constants
'
;
export
function
studentDataFieldsReducer
(
state
:
IStudentDataFields
=
STUDENT_DATA_FIELDS_INITIAL_STATE
,
action
):
IStudentDataFields
{
switch
(
action
.
type
)
{
...
...
@@ -19,6 +15,8 @@ export function studentDataFieldsReducer(state: IStudentDataFields = STUDENT_DAT
});
return
Seq
(
studentDataFields
).
map
(
n
=>
n
).
toList
();
case
STUDENTDATAFIELDS_INIT
:
return
STUDENT_DATA_FIELDS_INITIAL_STATE
;
default
:
return
state
;
}
};
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