Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/front-web/build/assets/fonts/iran-yekan/MobileFonts/wgdpf7/session.zip
Назад
PK �Lj[�#x x config/routes.jsonnu �[��� { "routes": [ { "method": "GET", "path": "/sessions", "handler": "session.find", "config": { "policies": [] } }, { "method": "GET", "path": "/sessions/count", "handler": "session.count", "config": { "policies": [] } }, { "method": "GET", "path": "/sessions/getSessionResources/:id", "handler": "session.getSessionResources", "config": { "policies": [] } }, { "method": "GET", "path": "/sessions/getResourcesForLevel/:id", "handler": "session.getResourcesForLevel", "config": { "policies": [] } }, { "method": "GET", "path": "/sessions/joinUserToMeeting/:id", "handler": "session.joinUserToMeeting", "config": { "policies": [] } }, { "method": "GET", "path": "/sessions/:id", "handler": "session.findOne", "config": { "policies": [] } }, { "method": "POST", "path": "/sessions", "handler": "session.create", "config": { "policies": [] } }, { "method": "POST", "path": "/sessions/saveSessionResources", "handler": "session.saveSessionResources", "config": { "policies": [] } }, { "method": "PUT", "path": "/sessions/:id", "handler": "session.update", "config": { "policies": [] } }, { "method": "DELETE", "path": "/sessions/:id", "handler": "session.delete", "config": { "policies": [] } } ] } PK �Lj[�5&��# �# controllers/session.jsnu �[��� 'use strict'; const fs = require("fs"); const axios = require('axios'); const qs = require('qs'); /** * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) * to customize this controller */ //https://helpx.adobe.com/adobe-connect/webservices/topics.html //https://helpx.adobe.com/adobe-connect/webservices/launch-meetings-external-authentication.html //https://helpx.adobe.com/adobe-connect/webservices/create-meeting-room-urls.html#create_meeting_room_urls //https://helpx.adobe.com/adobe-connect/webservices/create-meetings.html module.exports = { async create(ctx) { const model = {...ctx.request.body}; if (model.isAdobe) { const instance = axios.create({ baseURL: `${process.env.AC_SERVER}`, headers: {'X-Custom-Header': 'foobar'}, withCredentials: true }); let apiCall = `/api/xml?action=login&login=${process.env.AC_USER}&password=${process.env.AC_PASSWORD}`; try { const tokenInfo = await instance.get(apiCall, {withCredentials: true}); if (tokenInfo && tokenInfo.data) { let tokenData = await strapi.services.helpers.xml2Json(tokenInfo.data); tokenData = JSON.parse(tokenData); if (tokenData && tokenData.results && tokenData.results.status[0].$.code === "ok") { instance.defaults.headers = { Cookie: tokenInfo.headers["set-cookie"][0] }; apiCall = `/api/xml?action=sco-update&session=${tokenData.results.OWASP_CSRFTOKEN[0].token[0]}&type=meeting&name=${model.title}&folder-id=${process.env.AC_MEETING_FOLDER}`; const meetingInfo = await instance.get(encodeURI(apiCall), {withCredentials: true}); if (meetingInfo && meetingInfo.data) { let meetingData = await strapi.services.helpers.xml2Json(meetingInfo.data); meetingData = JSON.parse(meetingData); let invalid = meetingData.results.status[0].$.code === "invalid"; if (invalid) { invalid = meetingData.results.status[0].invalid[0]; return ctx.badRequest(null, `${invalid.$.field} ${invalid.$.subcode}`); } //make public apiCall = `/api/xml?action=permissions-update&acl-id=${meetingData.results.sco[0].$["sco-id"]}&principal-id=public-access&permission-id=view-hidden`; let updatePrincipal = await instance.get(apiCall, {withCredentials: true}); if (updatePrincipal && updatePrincipal.data) { apiCall = `/api/xml?action=permissions-update&principal-id=${process.env.AC_ADMIN_ID}&acl-id=${meetingData.results.sco[0].$["sco-id"]}&permission-id=host`; updatePrincipal = await instance.get(apiCall, {withCredentials: true}); if (updatePrincipal && updatePrincipal.data) { let principal = await strapi.services.helpers.xml2Json(updatePrincipal.data); principal = JSON.parse(principal); if (principal && principal.results && principal.results.status[0].$.code === "ok") { model.internalMeetingID = meetingData.results.sco[0]["url-path"][0]; const entity = await strapi.services.session.create(model); const result = { joinUrl: `${process.env.AC_SERVER}${entity.internalMeetingID.replace(/\//g, '')}`, }; return ctx.send(result); } } } } } } } catch (ex) { console.error("create meeting error", ex); let msg = ex.message; if (msg && msg.indexOf(".") >= 0) { msg = msg.replace(/./g, "-"); } else if (!msg) { msg = "خطای نامشخص"; } return ctx.badRequest(null, msg); } } else { if (model.attendeePW) { model.attendeePW = model.attendeePW.toString(); } const {user} = ctx.state; model.meta_isPublic = model.guestPolicy === "ALWAYS_ACCEPT"; model.meta_isPublicRegistred = model.guestPolicy === "ALWAYS_ACCEPT_REGISTERED"; model.meta_isPrivate = model.guestPolicy === "ALWAYS_DENY"; if (model.guestPolicy === "ALWAYS_DENY") { model.guestPolicy = "ASK_MODERATOR"; } if (model.guestPolicy === "ALWAYS_ACCEPT_REGISTERED") { model.guestPolicy = "ALWAYS_ACCEPT"; } model.link = ""; let meetingID = model.course_level; if (model.course_level === "public") { model.course_level = null; } const entity = await strapi.services.session.create(model); if (meetingID === "public") { meetingID = entity.id; } delete model.desc; delete model.title; model.meta_disallowRecording = model.disallowRecording; //id is COURSE_LEVEL_ID const meetingInfo = await strapi.services.helpers.createBBBMeeting(entity.title, meetingID, model); meetingInfo.dialNumber = meetingInfo.dialNumber ? meetingInfo.dialNumber.toString() : ''; meetingInfo.voiceBridge = meetingInfo.voiceBridge ? meetingInfo.voiceBridge.toString() : ''; await strapi.services.session.update({id: entity.id}, meetingInfo); const fullName = "مدرس: " + user.name + " " + (user.family!=null ? user.family : ""); const result = { joinUrl: await strapi.services.helpers.joinUserToMeeting(fullName, meetingID, meetingInfo.moderatorPW, user.id, false) }; if (model.meta_isPrivate) { const data = fs.readFileSync(`resources/emailTemplate/PrivateSession.html`, 'utf8'); const html = data.replace(/SESSION_TITLE/g, entity.title) .replace(/PASSWORD/g, model.attendeePW); strapi.services.helpers.sendEmail("papinaser@gmail.com", "رمز عبور جلسه خصوصی", html).then(); } return ctx.send(result); } //return sanitizeEntity(entity, { model: strapi.models.session }); }, async getSessionResources(ctx) { const {id} = ctx.params;//course_level_id const {user} = ctx.state; const entity = await strapi.services["session"].findOne({id}); const levels = await strapi.services.helpers.getCourseLevels(entity.course_level); const ids = levels.map(x => x.id); const users = await strapi.query('user-course').find({ isConfirm: true, course_levels_in: ids }); const availableUsers = users.map(x => ({ id: x.user.id, name: x.user.name, family: x.user.family, phoneNo: x.user.phoneNo, nationalCode: x.user.nationalCode })); const availableResources = await strapi.query("session-resource").find({ teacher_in: [user.id, null] }); return { availableUsers, availableResources, session_resources: entity.session_resources.map(x => x.id), disallow_users: entity.disallow_users.map(x => x.id) }; }, async saveSessionResources(ctx) { const model = {...ctx.request.body}; const entity = await strapi.services.session.update({id: model.id}, {session_resources: model.session_resources, disallow_users: model.disallow_users}); ctx.send(true); }, async joinUserToMeeting(ctx) { const {id} = ctx.params;//course_level_id const {user} = ctx.state; const adobeInfo = await strapi.services.helpers.isAdobeRunning(id, true); if (adobeInfo !== false) { const result = { joinUrl: adobeInfo }; return ctx.send(result); } const info = await strapi.services.helpers.getBBBMeetingInfo(id); if (info.returncode !== "SUCCESS" || !info.running) { return ctx.badRequest(null, "buyCourse.errors.classIsNotLive"); } const fullName = "مدرس: " + user.name + " " + (user.family!=null ? user.family : ""); const result = { joinUrl: await strapi.services.helpers.joinUserToMeeting(fullName, id, info.moderatorPW, user.id, false) }; return ctx.send(result); }, async getResourcesForLevel(ctx) { const {id} = ctx.params;//course_level_id const {user} = ctx.state; const levels = await strapi.services.helpers.getCourseLevels(id); const canAccess= await strapi.services.session.canAccessResources(user,levels,id); const isAdmin = strapi.services.helpers.isAdmin(user); if (canAccess.result===false){ return ctx.badRequest(null,canAccess.entity); } const ids = levels.map(x => x.id); const userId = user.id; const sessions = await strapi.query('session').find({ isPublished: true, course_level_in: ids, disallow_users_nin: [userId] }); sessions.map(session=>{ session.checkLicense= !isAdmin && !canAccess.userCourse.inactiveLicense && session.checkLicense session.canDownload = isAdmin || canAccess.userCourse.canDownload }) return sessions; }, }; PK �Lj['3�!d !d documentation/1.0.0/session.jsonnu �[��� { "paths": { "/sessions": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Session" } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "parameters": [ { "name": "_limit", "in": "query", "required": false, "description": "Maximum number of results possible", "schema": { "type": "integer" }, "deprecated": false }, { "name": "_sort", "in": "query", "required": false, "description": "Sort according to a specific field.", "schema": { "type": "string" }, "deprecated": false }, { "name": "_start", "in": "query", "required": false, "description": "Skip a specific number of entries (especially useful for pagination)", "schema": { "type": "integer" }, "deprecated": false }, { "name": "=", "in": "query", "required": false, "description": "Get entries that matches exactly your input", "schema": { "type": "string" }, "deprecated": false }, { "name": "_ne", "in": "query", "required": false, "description": "Get records that are not equals to something", "schema": { "type": "string" }, "deprecated": false }, { "name": "_lt", "in": "query", "required": false, "description": "Get record that are lower than a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_lte", "in": "query", "required": false, "description": "Get records that are lower than or equal to a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_gt", "in": "query", "required": false, "description": "Get records that are greater than a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_gte", "in": "query", "required": false, "description": "Get records that are greater than or equal a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_contains", "in": "query", "required": false, "description": "Get records that contains a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_containss", "in": "query", "required": false, "description": "Get records that contains (case sensitive) a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_in", "in": "query", "required": false, "description": "Get records that matches any value in the array of values", "schema": { "type": "array", "items": { "type": "string" } }, "deprecated": false }, { "name": "_nin", "in": "query", "required": false, "description": "Get records that doesn't match any value in the array of values", "schema": { "type": "array", "items": { "type": "string" } }, "deprecated": false } ] }, "post": { "deprecated": false, "description": "Create a new record", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Session" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "requestBody": { "description": "", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewSession" } } } } } }, "/sessions/count": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "count": { "type": "integer" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "parameters": [] } }, "/sessions/getSessionResources/{id}": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] } }, "/sessions/getResourcesForLevel/{id}": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] } }, "/sessions/joinUserToMeeting/{id}": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] } }, "/sessions/{id}": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Session" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] }, "put": { "deprecated": false, "description": "Update a record", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Session" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "requestBody": { "description": "", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewSession" } } } }, "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] }, "delete": { "deprecated": false, "description": "Delete a record", "responses": { "200": { "description": "deletes a single record based on the ID supplied", "content": { "application/json": { "schema": { "type": "integer", "format": "int64" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] } }, "/sessions/saveSessionResources": { "post": { "deprecated": false, "description": "Create a new record", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "Session" ], "requestBody": { "description": "", "required": true, "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } } } } }, "components": { "schemas": { "Session": { "required": [ "id", "title" ], "properties": { "id": { "type": "string" }, "title": { "type": "string", "minLength": 3 }, "desc": { "type": "string" }, "link": { "type": "string" }, "isLive": { "type": "boolean" }, "session_resources": { "type": "array", "items": { "required": [ "id", "title" ], "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "resource": { "type": "string" }, "downloadUrl": { "type": "string" }, "teacher": { "type": "string" }, "published_at": { "type": "string" }, "created_by": { "type": "string" }, "updated_by": { "type": "string" } } } }, "isPublished": { "type": "boolean" }, "disallow_users": { "type": "array", "items": { "required": [ "id", "username", "email", "name", "phoneNo" ], "properties": { "id": { "type": "string" }, "username": { "type": "string" }, "email": { "type": "string" }, "provider": { "type": "string" }, "password": { "type": "string" }, "resetPasswordToken": { "type": "string" }, "confirmed": { "type": "boolean" }, "blocked": { "type": "boolean" }, "role": { "type": "string" }, "name": { "type": "string" }, "family": { "type": "string" }, "phoneNo": { "type": "integer" }, "avatarImage": { "type": "string" }, "nationalCode": { "type": "string" }, "created_by": { "type": "string" }, "updated_by": { "type": "string" } } } }, "isAdobe": { "type": "boolean" }, "checkLicense": { "type": "boolean", "default": false }, "internalMeetingID": { "type": "string" }, "logoutURL": { "type": "string" }, "record": { "type": "boolean" }, "sequence": { "type": "integer" }, "copyright": { "type": "string" }, "test": { "type": "string" }, "disallowRecording": { "type": "boolean" }, "offlineLink": { "type": "string" } } }, "NewSession": { "required": [ "title" ], "properties": { "title": { "type": "string", "minLength": 3 }, "desc": { "type": "string" }, "link": { "type": "string" }, "isLive": { "type": "boolean" }, "session_resources": { "type": "array", "items": { "type": "string" } }, "course_level": { "type": "string" }, "isPublished": { "type": "boolean" }, "disallow_users": { "type": "array", "items": { "type": "string" } }, "isAdobe": { "type": "boolean" }, "checkLicense": { "type": "boolean", "default": false }, "internalMeetingID": { "type": "string" }, "logoutURL": { "type": "string" }, "record": { "type": "boolean" }, "sequence": { "type": "integer" }, "copyright": { "type": "string" }, "test": { "type": "string" }, "disallowRecording": { "type": "boolean" }, "offlineLink": { "type": "string" }, "created_by": { "type": "string" }, "updated_by": { "type": "string" } } } } }, "tags": [ { "name": "Session" } ] }PK �Lj[t�m� � models/session.jsnu �[��� 'use strict'; /** * Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks) * to customize this model */ module.exports = { }; PK �Lj[ ��C C models/session.settings.jsonnu �[��� { "kind": "collectionType", "collectionName": "sessions", "info": { "name": "session", "description": "" }, "options": { "increments": true, "timestamps": true, "draftAndPublish": false }, "attributes": { "title": { "type": "string", "required": true, "minLength": 3 }, "desc": { "type": "text" }, "link": { "type": "string", "required": false, "unique": false }, "isLive": { "type": "boolean" }, "session_resources": { "collection": "session-resource" }, "course_level": { "private": true, "model": "course-level" }, "isPublished": { "type": "boolean" }, "disallow_users": { "plugin": "users-permissions", "collection": "user" }, "isAdobe": { "type": "boolean" }, "checkLicense": { "type": "boolean", "default": false }, "internalMeetingID": { "type": "string" }, "logoutURL": { "type": "string" }, "record": { "type": "boolean" }, "sequence": { "type": "integer" }, "copyright": { "type": "string" }, "test": { "type": "string" }, "disallowRecording": { "type": "boolean" }, "offlineLink": { "type": "string" } } } PK �Lj[�@uz services/session.jsnu �[��� 'use strict'; /** * Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services) * to customize this service */ module.exports = { async canAccessResources(user,levels,thisLevelId){ const isAdmin = strapi.services.helpers.isAdmin(user); if (!isAdmin){ const ids = levels.map(x => x.id); ids.push(thisLevelId); let userCourse= await strapi.query("user-course").find({ user:user.id,isConfirm:true,course_levels_in:ids }); if (userCourse===null || userCourse.length===0){ return { result: false, entity: "course.errors.courseNotFound" }; } userCourse= userCourse[0]; let expiredDate = userCourse.expiredDate; if (!expiredDate){ expiredDate= strapi.services.helpers.addDays(userCourse.factorDate,366); }else{ expiredDate= new Date(expiredDate); } if (expiredDate.getTime() < new Date().getTime()){ return { result: false, entity: "course.errors.usingIsExpired" }; } return { result:true, entity: levels, userCourse, } } return { result: true, entity: levels }; } }; PK �Lj[�#x x config/routes.jsonnu �[��� PK �Lj[�5&��# �# � controllers/session.jsnu �[��� PK �Lj['3�!d !d �* documentation/1.0.0/session.jsonnu �[��� PK �Lj[t�m� � � models/session.jsnu �[��� PK �Lj[ ��C C �� models/session.settings.jsonnu �[��� PK �Lj[�@uz �� services/session.jsnu �[��� PK �
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка