Skip to content

Commit c6bf3ed

Browse files
committed
CONF up1 common
1 parent a0bf166 commit c6bf3ed

File tree

9 files changed

+676
-23
lines changed

9 files changed

+676
-23
lines changed

app/src/controllers/CompareUsers.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<template>
22
<div>
3-
<p><b>{{homonyme.mail || homonyme.uid || homonyme.supannMailPerso || homonyme.barcode}}</b> <span v-html="homonyme.global_main_profile.description"></span></p>
3+
<p><b>
4+
<a v-if="homonyme.uid" :href="'https://userinfo.univ-paris1.fr/#' + (homonyme.mail || homonyme.uid)">{{homonyme.mail || homonyme.uid}}</a>
5+
<span v-else>{{homonyme.supannMailPerso || homonyme.barcode}}</span>
6+
</b> <span v-html="homonyme.global_main_profile.description"></span></p>
47

58
<table class="table table-bordered">
69
<tbody>

app/src/controllers/StepV.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020

2121
<div v-if="v_ldap && v_ldap.global_main_profile && !(v.global_main_profile && v.global_main_profile.description === v_ldap.global_main_profile.description) && !merged_homonyms.some(h => h.uid === v_ldap.uid)" class="alert alert-info">
22-
La demande concerne le compte existant « {{v_ldap.uid}} »
22+
La demande concerne le compte existant « <a style="text-decoration: underline;" :href="'https://userinfo.univ-paris1.fr/#' + v_ldap.uid">{{v_ldap.uid}}</a> »
2323
({{v_ldap.givenName}} {{v_ldap.sn}} <span v-html="v_ldap.global_main_profile.description"></span>)
2424
</div>
2525

app/src/router.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ export let router;
1010

1111
const _routes = {
1212
'/playground': () => import('./controllers/Playground.vue'),
13-
'/login/:kind?': { render(_h) { router.replace(this.$route.query.then) } }, // TODO, use vue-router redirect
13+
'/login/:kind?': { render(_h) {
14+
const then = this.$route.query.then;
15+
if ("reload_to_test" in this.$route.query)
16+
document.location.href = conf.base_pathname + "test/#" + then;
17+
else
18+
router.replace(then) // TODO, use vue-router redirect
19+
} },
1420
'/steps/:kind?': ModerateList,
1521
'/:stepName/:wanted_id?': Step,
1622
'/': { template: template_welcome },
@@ -29,8 +35,7 @@ const opts = {
2935
routes,
3036
};
3137

32-
declare var process;
33-
if (process.env.NODE_ENV === 'production') {
38+
if (!conf.base_pathname.match(/\/test\/$/)) {
3439
opts.mode = 'history';
3540
}
3641

app/src/services/ws.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export interface InitialSteps {
3939

4040
import conf from '../conf';
4141

42-
const api_url = conf.base_pathname + 'api';
42+
const non_test_base_pathname = conf.base_pathname.replace(/\/test\/$/, '/');
43+
const api_url = non_test_base_pathname + 'api';
4344

4445
export function eachAttrs(attrs: StepAttrsOption, oneOfTraversal: 'always' | 'never', f: (opts: StepAttrOption, key: string, attrs: StepAttrsOption) => void) {
4546
function rec_mpp(mpp: Mpp) {
@@ -141,7 +142,11 @@ function _handleErr(err : AxiosError, $scope = null, redirect = false) {
141142
console.log("must relog", resp.headers.toString());
142143
restarting = true;
143144
const type = resp.data && resp.data.authenticate && resp.data.authenticate.type || $scope.$route.query.idp || 'local';
144-
const location = conf.base_pathname + 'login/' + type + '?then=' + encodeURIComponent($scope.$route.fullPath);
145+
const need_reload_to_test = type === 'cas_with_pgt' && conf.base_pathname !== non_test_base_pathname;
146+
const location =
147+
(need_reload_to_test ? non_test_base_pathname : conf.base_pathname) +
148+
'login/' + type + '?then=' + encodeURIComponent($scope.$route.fullPath) +
149+
(need_reload_to_test ? "&reload_to_test" : '');
145150
document.location.href = resp.data?.authenticate?.need_relog_local ? `/Shibboleth.sso/Logout?return=${encodeURIComponent(location)}` : location
146151
return Promise.reject("logging...");
147152
} else if (resp.status === 401) {

server/conf.ts

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { sameKeyNameChoices } from './helpers';
1111
import * as grouped_calls from './helper_grouped_calls';
1212
import shared_conf from '../shared/conf';
1313

14-
const ldap_base = "dc=univ,dc=fr";
14+
const ldap_base = "dc=univ-paris1,dc=fr";
1515
const ldap_main = {
16-
uri: ['ldap://ldap-test.univ.fr'],
16+
uri: ['ldap://ldap-pmf2.univ-paris1.fr', 'ldap://ldap-pth2.univ-paris1.fr', 'ldap://ldap-pth1.univ-paris1.fr'],
1717

1818
// empty for anonymous bind:
1919
dn: 'cn=comptex,ou=admin,' + ldap_base,
@@ -27,23 +27,24 @@ const ldap_main = {
2727
base_rolesGeneriques: "ou=supannRoleGenerique,ou=tables," + ldap_base,
2828
base_etablissements: "ou=supannEtablissement,ou=tables," + ldap_base,
2929

30-
uid_to_eppn: "@univ.fr",
30+
uid_to_eppn: "@univ-paris1.fr",
3131
};
3232

3333
const internal_organizations = [
3434
'{UAI}0751717J', // Univ Paris 1
3535
'{UAI}0752719Y', // SCD
36+
'{UAI}0753364Z', // IAE
3637
];
3738

3839
const conf = {
3940
maxLiveModerators: 100,
4041

41-
mainUrl: 'https://comptex.univ.fr' + shared_conf.base_pathname.replace(/\/$/, ''),
42+
mainUrl: 'https://comptex.univ-paris1.fr' + shared_conf.base_pathname.replace(/\/$/, ''),
4243

4344
mail: {
44-
from: 'Assistance <assistance@univ.fr>',
45-
intercept: 'Admin <[email protected]>',
46-
transport: sendmailTransport({}),
45+
from: 'DSIUN Université Paris 1 Panthéon-Sorbonne <no-reply@univ-paris1.fr>',
46+
intercept: '', //'Admin <[email protected]>',
47+
transport: sendmailTransport({ path: '/usr/sbin/sendmail' }), // give sendmail with full path (since PATH may not have /usr/sbin/)
4748
},
4849

4950
sv_ttl_days: 1/*year*/ * 365, // auto-purge after xxx days unmodified
@@ -53,15 +54,15 @@ const conf = {
5354
},
5455

5556
esup_activ_bo: {
56-
url: "http://xxxx.univ.fr:8080/esup-activ-bo/",
57+
url: "http://marmite.univ-paris1.fr:8080/esup-activ-bo/",
5758
},
5859

5960
esupUserApps: {
60-
url: '', //'https://ent.univ.fr/EsupUserApps',
61+
url: 'https://ent.univ-paris1.fr/EsupUserApps',
6162
},
6263

6364
ldap: {
64-
shibIdentityProvider: 'https://idp.univ.fr',
65+
shibIdentityProvider: 'urn:mace:cru.fr:federation:univ-paris1.fr',
6566

6667
...ldap_main,
6768

@@ -152,10 +153,13 @@ const conf = {
152153
supannCodeINE: '',
153154

154155
termsOfUse: [''],
156+
supannConsentement: [''],
155157
supannListeRouge: '',
156158

159+
comment: '', demandeUrl: '',
157160
up1Profile: [] as any[],
158-
'{SMSU}CG': '', '{PHOTO}PUBLIC': '', '{PHOTO}INTRANET': '', '{PHOTO}STUDENT': '',
161+
'{SMSU}CG': '', '{PAGER}DISPLAY.FACULTY': '', '{PHOTO}PUBLIC': '', '{PHOTO}INTRANET': '', '{PHOTO}STUDENT': '',
162+
'{APPLI:OFFICE365}CGU': '',
159163
},
160164

161165
attrs : {
@@ -166,6 +170,8 @@ const conf = {
166170
altGivenName: { ldapAttr: 'up1AltGivenName' },
167171
floorNumber: { ldapAttr: 'up1FloorNumber' },
168172
roomAccess: { ldapAttr: 'up1RoomAccess' },
173+
comment: { ldapAttr: 'info;x-demande' },
174+
demandeUrl: { ldapAttr: 'labeledURI', convert: ldap_convert.withSuffixEtiquette(' {DEMANDE}') },
169175
up1Profile: { convert: ldap_convert.up1Profile },
170176
global_profilename: { ldapAttr: 'up1Profile', convert: ldap_convert.up1Profile_field('up1Source') },
171177
profilename: { ldapAttr: 'up1Source', ldapAttrJson: 'profilename' },
@@ -188,17 +194,25 @@ const conf = {
188194
global_siham: { ldapAttr: 'supannRefId', convert: ldap_convert.withEtiquette("{SIHAM}") },
189195
jpegPhoto: { ldapAttr: 'jpegPhoto;base64' },
190196
termsOfUse: { ldapAttr: 'up1TermsOfUse' },
191-
..._.fromPairs(['{SMSU}CG', '{PHOTO}PUBLIC', '{PHOTO}INTRANET', '{PHOTO}STUDENT'].map(value =>
197+
..._.fromPairs(['{SMSU}CG', '{PAGER}DISPLAY.FACULTY', '{PHOTO}PUBLIC', '{PHOTO}INTRANET', '{PHOTO}STUDENT'].map(value =>
192198
[ value, { ldapAttr: 'up1TermsOfUse', convert: ldap_convert.has_value(value) } ]
193199
)),
200+
..._.fromPairs(['{APPLI:OFFICE365}CGU'].map(value =>
201+
[ value, { ldapAttr: 'supannConsentement', convert: ldap_convert.has_value(value) } ]
202+
)),
194203
},
195204
supannCiviliteChoices: sameKeyNameChoices([ 'M.', 'Mme' ]),
196205

197206
mail_domains: [
207+
'univ-paris1.fr',
208+
'etu.univ-paris1.fr',
209+
'malix.univ-paris1.fr',
210+
'anciens.univ-paris1.fr',
211+
'bis-sorbonne.fr',
198212
] as string[],
199213

200-
homonymes_preferStudent: (profilename: string) => !!(profilename || '').match(/^\{COMPTEX\}learner\./),
201-
homonymes_restriction: '(objectClass=inetOrgPerson)',
214+
homonymes_preferStudent: (profilename: string) => !!(profilename || '').match(/^\{COMPTEX:FC\}learner\./),
215+
homonymes_restriction: '(&(objectClass=inetOrgPerson)(!(shadowFlag=2))(!(shadowFlag=8)))' // ignore dupes/deceased
202216
},
203217

204218
group_cn_to_memberOf: (cn: string) => (
@@ -232,6 +246,7 @@ const conf = {
232246
sn: 'sn',
233247
givenName: 'givenName',
234248
displayName: 'displayName',
249+
supannEtablissement: 'supannEtablissement',
235250
},
236251
},
237252

@@ -256,7 +271,7 @@ const conf = {
256271
path: "/tmp"
257272
} as session_file_store.Options,
258273

259-
trust_proxy: ['loopback'],
274+
trust_proxy: ['loopback', /*ent-front*/ '193.55.96.44', '2001:660:3305::44'],
260275

261276
cas: {
262277
ssoBaseURL: '', //'https://cas.univ.fr/cas/',

0 commit comments

Comments
 (0)