Version 14.36

This commit is contained in:
Antonio Cañas Vargas 2014-12-12 20:25:00 +01:00
parent 66a616f4ef
commit e2ce32ab4a
70 changed files with 589 additions and 19079 deletions

View File

@ -40,7 +40,7 @@ OBJS = swad_action.o swad_announcement.o swad_assignment.o swad_attendance.o \
swad_network.o swad_nickname.o swad_notice.o swad_notification.o \
swad_pagination.o swad_parameter.o swad_password.o swad_photo.o swad_place.o swad_plugin.o swad_preference.o \
swad_QR.o \
swad_record.o swad_RSS.o \
swad_record.o swad_role.o swad_RSS.o \
swad_scope.o swad_search.o swad_session.o swad_setup.o swad_statistic.o swad_string.o swad_survey.o swad_syllabus.o \
swad_test.o swad_test_import.o swad_theme.o swad_timetable.o \
swad_user.o \

11292
soap/soapC.c

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -1,20 +0,0 @@
/* soapServerLib.c
Generated by gSOAP 2.8.18 from swad_web_service.h
Copyright(C) 2000-2014, Robert van Engelen, Genivia Inc. All Rights Reserved.
The generated code is released under one of the following licenses:
GPL or Genivia's license for commercial use.
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
*/
/** Use this file in your project build instead of the two files soapC.c and soapServer.c. This hides the serializer functions and avoids linking problems when linking multiple clients and servers. */
#ifndef WITH_NOGLOBAL
#define WITH_NOGLOBAL
#endif
#define SOAP_FMAC3 static
#include "soapC.c"
#include "soapServer.c"
/* End of soapServerLib.c */

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:createAccount>
<userNickname></userNickname>
<userEmail></userEmail>
<userID></userID>
<userPassword></userPassword>
<appKey></appKey>
</swad:createAccount>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:createAccountOutput>
<userCode>0</userCode>
<string></string>
</swad:createAccountOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getAttendanceEvents>
<wsKey></wsKey>
<courseCode>0</courseCode>
</swad:getAttendanceEvents>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getAttendanceEventsOutput>
<numEvents>0</numEvents>
<eventsArray>
<item>
<attendanceEventCode>0</attendanceEventCode>
<hidden>0</hidden>
<userSurname1></userSurname1>
<userSurname2></userSurname2>
<userFirstname></userFirstname>
<userPhoto></userPhoto>
<startTime>0</startTime>
<endTime>0</endTime>
<commentsTeachersVisible>0</commentsTeachersVisible>
<title></title>
<text></text>
<groups></groups>
</item>
</eventsArray>
</swad:getAttendanceEventsOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getAttendanceUsers>
<wsKey></wsKey>
<attendanceEventCode>0</attendanceEventCode>
</swad:getAttendanceUsers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getAttendanceUsersOutput>
<numUsers>0</numUsers>
<usersArray>
<item>
<userCode>0</userCode>
<userNickname></userNickname>
<userID></userID>
<userSurname1></userSurname1>
<userSurname2></userSurname2>
<userFirstname></userFirstname>
<userPhoto></userPhoto>
<present>0</present>
</item>
</usersArray>
</swad:getAttendanceUsersOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getCourseInfo>
<wsKey></wsKey>
<courseCode>0</courseCode>
<infoType></infoType>
</swad:getCourseInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getCourseInfoOutput>
<infoSrc></infoSrc>
<infoTxt></infoTxt>
</swad:getCourseInfoOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getCourses>
<wsKey></wsKey>
</swad:getCourses>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getCoursesOutput>
<numCourses>0</numCourses>
<coursesArray>
<item>
<courseCode>0</courseCode>
<courseShortName></courseShortName>
<courseFullName></courseFullName>
<userRole>0</userRole>
</item>
</coursesArray>
</swad:getCoursesOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getDirectoryTree>
<wsKey></wsKey>
<courseCode>0</courseCode>
<groupCode>0</groupCode>
<treeCode>0</treeCode>
</swad:getDirectoryTree>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getDirectoryTreeOutput>
<tree></tree>
</swad:getDirectoryTreeOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getFile>
<wsKey></wsKey>
<fileCode>0</fileCode>
</swad:getFile>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getFileOutput>
<fileName></fileName>
<URL></URL>
<size>0</size>
<time>0</time>
<license></license>
<publisherName></publisherName>
<publisherPhoto></publisherPhoto>
</swad:getFileOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getGroupTypes>
<wsKey></wsKey>
<courseCode>0</courseCode>
</swad:getGroupTypes>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getGroupTypesOutput>
<numGroupTypes>0</numGroupTypes>
<groupTypesArray>
<item>
<groupTypeCode>0</groupTypeCode>
<groupTypeName></groupTypeName>
<mandatory>0</mandatory>
<multiple>0</multiple>
<openTime>0</openTime>
</item>
</groupTypesArray>
</swad:getGroupTypesOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getGroups>
<wsKey></wsKey>
<courseCode>0</courseCode>
</swad:getGroups>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getGroupsOutput>
<numGroups>0</numGroups>
<groupsArray>
<item>
<groupCode>0</groupCode>
<groupName></groupName>
<groupTypeCode>0</groupTypeCode>
<groupTypeName></groupTypeName>
<open>0</open>
<maxStudents>0</maxStudents>
<numStudents>0</numStudents>
<fileZones>0</fileZones>
<member>0</member>
</item>
</groupsArray>
</swad:getGroupsOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getMarks>
<wsKey></wsKey>
<fileCode>0</fileCode>
</swad:getMarks>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getMarksOutput>
<content></content>
</swad:getMarksOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getNewPassword>
<userID></userID>
<appKey></appKey>
</swad:getNewPassword>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getNewPasswordOutput>
<success>0</success>
</swad:getNewPasswordOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getNotifications>
<wsKey></wsKey>
<beginTime>0</beginTime>
</swad:getNotifications>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getNotificationsOutput>
<numNotifications>0</numNotifications>
<notificationsArray>
<item>
<notifCode>0</notifCode>
<eventType></eventType>
<eventCode>0</eventCode>
<eventTime>0</eventTime>
<userNickname></userNickname>
<userSurname1></userSurname1>
<userSurname2></userSurname2>
<userFirstname></userFirstname>
<userPhoto></userPhoto>
<location></location>
<status>0</status>
<summary></summary>
<content></content>
</item>
</notificationsArray>
</swad:getNotificationsOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getTestConfig>
<wsKey></wsKey>
<courseCode>0</courseCode>
</swad:getTestConfig>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getTestConfigOutput>
<pluggable>0</pluggable>
<numQuestions>0</numQuestions>
<minQuestions>0</minQuestions>
<defQuestions>0</defQuestions>
<maxQuestions>0</maxQuestions>
<feedback></feedback>
</swad:getTestConfigOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getTests>
<wsKey></wsKey>
<courseCode>0</courseCode>
<beginTime>0</beginTime>
</swad:getTests>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getTestsOutput>
<tagsArray>
<item>
<tagCode>0</tagCode>
<tagText></tagText>
</item>
</tagsArray>
<questionsArray>
<item>
<questionCode>0</questionCode>
<answerType></answerType>
<shuffle>0</shuffle>
<stem></stem>
<feedback></feedback>
</item>
</questionsArray>
<answersArray>
<item>
<questionCode>0</questionCode>
<answerIndex>0</answerIndex>
<correct>0</correct>
<answerText></answerText>
<answerFeedback></answerFeedback>
</item>
</answersArray>
<questionTagsArray>
<item>
<questionCode>0</questionCode>
<tagCode>0</tagCode>
<tagIndex>0</tagIndex>
</item>
</questionTagsArray>
</swad:getTestsOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getUsers>
<wsKey></wsKey>
<courseCode>0</courseCode>
<groupCode>0</groupCode>
<userRole>0</userRole>
</swad:getUsers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:getUsersOutput>
<numUsers>0</numUsers>
<usersArray>
<item>
<userCode>0</userCode>
<userNickname></userNickname>
<userID></userID>
<userSurname1></userSurname1>
<userSurname2></userSurname2>
<userFirstname></userFirstname>
<userPhoto></userPhoto>
</item>
</usersArray>
</swad:getUsersOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:loginBySessionKey>
<sessionID></sessionID>
<appKey></appKey>
</swad:loginBySessionKey>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:loginBySessionKeyOutput>
<userCode>0</userCode>
<degreeTypeCode>0</degreeTypeCode>
<degreeCode>0</degreeCode>
<courseCode>0</courseCode>
<wsKey></wsKey>
<userNickname></userNickname>
<userID></userID>
<userSurname1></userSurname1>
<userSurname2></userSurname2>
<userFirstname></userFirstname>
<userPhoto></userPhoto>
<userBirthday></userBirthday>
<userRole>0</userRole>
<degreeTypeName></degreeTypeName>
<degreeName></degreeName>
<courseName></courseName>
</swad:loginBySessionKeyOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:loginByUserPasswordKey>
<userID></userID>
<userPassword></userPassword>
<appKey></appKey>
</swad:loginByUserPasswordKey>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:loginByUserPasswordKeyOutput>
<userCode>0</userCode>
<wsKey></wsKey>
<userNickname></userNickname>
<userID></userID>
<userSurname1></userSurname1>
<userSurname2></userSurname2>
<userFirstname></userFirstname>
<userPhoto></userPhoto>
<userBirthday></userBirthday>
<userRole>0</userRole>
</swad:loginByUserPasswordKeyOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:markNotificationsAsRead>
<wsKey></wsKey>
<notifications></notifications>
</swad:markNotificationsAsRead>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:markNotificationsAsReadOutput>
<numNotifications>0</numNotifications>
</swad:markNotificationsAsReadOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,11 +0,0 @@
#include "soapH.h"
SOAP_NMAC struct Namespace namespaces[] =
{
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL},
{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL},
{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
{"swad", "urn:swad", NULL, NULL},
{NULL, NULL, NULL, NULL}
};

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendAttendanceEvent>
<wsKey></wsKey>
<attendanceEventCode>0</attendanceEventCode>
<courseCode>0</courseCode>
<hidden>0</hidden>
<startTime>0</startTime>
<endTime>0</endTime>
<commentsTeachersVisible>0</commentsTeachersVisible>
<title></title>
<text></text>
<groups></groups>
</swad:sendAttendanceEvent>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendAttendanceEventOutput>
<attendanceEventCode>0</attendanceEventCode>
</swad:sendAttendanceEventOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendAttendanceUsers>
<wsKey></wsKey>
<attendanceEventCode>0</attendanceEventCode>
<users></users>
<setOthersAsAbsent>0</setOthersAsAbsent>
</swad:sendAttendanceUsers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendAttendanceUsersOutput>
<success>0</success>
<numUsers>0</numUsers>
</swad:sendAttendanceUsersOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendMessage>
<wsKey></wsKey>
<messageCode>0</messageCode>
<to></to>
<subject></subject>
<body></body>
</swad:sendMessage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendMessageOutput>
<numUsers>0</numUsers>
<usersArray>
<item>
<userCode>0</userCode>
<userNickname></userNickname>
<userID></userID>
<userSurname1></userSurname1>
<userSurname2></userSurname2>
<userFirstname></userFirstname>
<userPhoto></userPhoto>
</item>
</usersArray>
</swad:sendMessageOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendMyGroups>
<wsKey></wsKey>
<courseCode>0</courseCode>
<myGroups></myGroups>
</swad:sendMyGroups>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendMyGroupsOutput>
<success>0</success>
<numGroups>0</numGroups>
<groupsArray>
<item>
<groupCode>0</groupCode>
<groupName></groupName>
<groupTypeCode>0</groupTypeCode>
<groupTypeName></groupTypeName>
<open>0</open>
<maxStudents>0</maxStudents>
<numStudents>0</numStudents>
<fileZones>0</fileZones>
<member>0</member>
</item>
</groupsArray>
</swad:sendMyGroupsOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendNotice>
<wsKey></wsKey>
<courseCode>0</courseCode>
<body></body>
</swad:sendNotice>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad">
<SOAP-ENV:Body>
<swad:sendNoticeOutput>
<noticeCode>0</noticeCode>
</swad:sendNoticeOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

File diff suppressed because it is too large Load Diff

View File

@ -1,673 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="urn:swad"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:swad="urn:swad"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="course"><!-- swad__course -->
<sequence>
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__course::courseCode -->
<element name="courseShortName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__course::courseShortName -->
<element name="courseFullName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__course::courseFullName -->
<element name="userRole" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__course::userRole -->
</sequence>
</complexType>
<complexType name="coursesArray"><!-- swad__coursesArray -->
<sequence>
<element name="item" type="swad:course" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="groupType"><!-- swad__groupType -->
<sequence>
<element name="groupTypeCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__groupType::groupTypeCode -->
<element name="groupTypeName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__groupType::groupTypeName -->
<element name="mandatory" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__groupType::mandatory -->
<element name="multiple" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__groupType::multiple -->
<element name="openTime" type="xsd:long" minOccurs="1" maxOccurs="1"/><!-- swad__groupType::openTime -->
</sequence>
</complexType>
<complexType name="groupTypesArray"><!-- swad__groupTypesArray -->
<sequence>
<element name="item" type="swad:groupType" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="group"><!-- swad__group -->
<sequence>
<element name="groupCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__group::groupCode -->
<element name="groupName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__group::groupName -->
<element name="groupTypeCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__group::groupTypeCode -->
<element name="groupTypeName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__group::groupTypeName -->
<element name="open" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__group::open -->
<element name="maxStudents" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__group::maxStudents -->
<element name="numStudents" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__group::numStudents -->
<element name="fileZones" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__group::fileZones -->
<element name="member" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__group::member -->
</sequence>
</complexType>
<complexType name="groupsArray"><!-- swad__groupsArray -->
<sequence>
<element name="item" type="swad:group" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="notification"><!-- swad__notification -->
<sequence>
<element name="notifCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__notification::notifCode -->
<element name="eventType" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::eventType -->
<element name="eventCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__notification::eventCode -->
<element name="eventTime" type="xsd:long" minOccurs="1" maxOccurs="1"/><!-- swad__notification::eventTime -->
<element name="userNickname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::userNickname -->
<element name="userSurname1" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::userSurname1 -->
<element name="userSurname2" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::userSurname2 -->
<element name="userFirstname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::userFirstname -->
<element name="userPhoto" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::userPhoto -->
<element name="location" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::location -->
<element name="status" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__notification::status -->
<element name="summary" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::summary -->
<element name="content" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__notification::content -->
</sequence>
</complexType>
<complexType name="notificationsArray"><!-- swad__notificationsArray -->
<sequence>
<element name="item" type="swad:notification" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="tag"><!-- swad__tag -->
<sequence>
<element name="tagCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__tag::tagCode -->
<element name="tagText" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__tag::tagText -->
</sequence>
</complexType>
<complexType name="tagsArray"><!-- swad__tagsArray -->
<sequence>
<element name="item" type="swad:tag" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="question"><!-- swad__question -->
<sequence>
<element name="questionCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__question::questionCode -->
<element name="answerType" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__question::answerType -->
<element name="shuffle" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__question::shuffle -->
<element name="stem" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__question::stem -->
<element name="feedback" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__question::feedback -->
</sequence>
</complexType>
<complexType name="questionsArray"><!-- swad__questionsArray -->
<sequence>
<element name="item" type="swad:question" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="answer"><!-- swad__answer -->
<sequence>
<element name="questionCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__answer::questionCode -->
<element name="answerIndex" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__answer::answerIndex -->
<element name="correct" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__answer::correct -->
<element name="answerText" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__answer::answerText -->
<element name="answerFeedback" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__answer::answerFeedback -->
</sequence>
</complexType>
<complexType name="answersArray"><!-- swad__answersArray -->
<sequence>
<element name="item" type="swad:answer" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="questionTag"><!-- swad__questionTag -->
<sequence>
<element name="questionCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__questionTag::questionCode -->
<element name="tagCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__questionTag::tagCode -->
<element name="tagIndex" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__questionTag::tagIndex -->
</sequence>
</complexType>
<complexType name="questionTagsArray"><!-- swad__questionTagsArray -->
<sequence>
<element name="item" type="swad:questionTag" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="user"><!-- swad__user -->
<sequence>
<element name="userCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__user::userCode -->
<element name="userNickname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__user::userNickname -->
<element name="userID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__user::userID -->
<element name="userSurname1" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__user::userSurname1 -->
<element name="userSurname2" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__user::userSurname2 -->
<element name="userFirstname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__user::userFirstname -->
<element name="userPhoto" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__user::userPhoto -->
</sequence>
</complexType>
<complexType name="usersArray"><!-- swad__usersArray -->
<sequence>
<element name="item" type="swad:user" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="attendanceEvent"><!-- swad__attendanceEvent -->
<sequence>
<element name="attendanceEventCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__attendanceEvent::attendanceEventCode -->
<element name="hidden" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__attendanceEvent::hidden -->
<element name="userSurname1" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceEvent::userSurname1 -->
<element name="userSurname2" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceEvent::userSurname2 -->
<element name="userFirstname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceEvent::userFirstname -->
<element name="userPhoto" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceEvent::userPhoto -->
<element name="startTime" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__attendanceEvent::startTime -->
<element name="endTime" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__attendanceEvent::endTime -->
<element name="commentsTeachersVisible" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__attendanceEvent::commentsTeachersVisible -->
<element name="title" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceEvent::title -->
<element name="text" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceEvent::text -->
<element name="groups" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceEvent::groups -->
</sequence>
</complexType>
<complexType name="attendanceEventsArray"><!-- swad__attendanceEventsArray -->
<sequence>
<element name="item" type="swad:attendanceEvent" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<complexType name="attendanceUser"><!-- swad__attendanceUser -->
<sequence>
<element name="userCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__attendanceUser::userCode -->
<element name="userNickname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceUser::userNickname -->
<element name="userID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceUser::userID -->
<element name="userSurname1" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceUser::userSurname1 -->
<element name="userSurname2" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceUser::userSurname2 -->
<element name="userFirstname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceUser::userFirstname -->
<element name="userPhoto" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__attendanceUser::userPhoto -->
<element name="present" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__attendanceUser::present -->
</sequence>
</complexType>
<complexType name="attendanceUsersArray"><!-- swad__attendanceUsersArray -->
<sequence>
<element name="item" type="swad:attendanceUser" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<!-- operation request element -->
<element name="createAccount">
<complexType>
<sequence>
<element name="userNickname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__createAccount::userNickname -->
<element name="userEmail" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__createAccount::userEmail -->
<element name="userID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__createAccount::userID -->
<element name="userPassword" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__createAccount::userPassword -->
<element name="appKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__createAccount::appKey -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="createAccountOutput">
<complexType>
<sequence>
<element name="userCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__createAccountOutput::userCode -->
<element name="string" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__createAccountOutput::string -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="loginByUserPasswordKey">
<complexType>
<sequence>
<element name="userID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKey::userID -->
<element name="userPassword" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKey::userPassword -->
<element name="appKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKey::appKey -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="loginByUserPasswordKeyOutput">
<complexType>
<sequence>
<element name="userCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__loginByUserPasswordKeyOutput::userCode -->
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKeyOutput::wsKey -->
<element name="userNickname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKeyOutput::userNickname -->
<element name="userID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKeyOutput::userID -->
<element name="userSurname1" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKeyOutput::userSurname1 -->
<element name="userSurname2" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKeyOutput::userSurname2 -->
<element name="userFirstname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKeyOutput::userFirstname -->
<element name="userPhoto" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKeyOutput::userPhoto -->
<element name="userBirthday" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginByUserPasswordKeyOutput::userBirthday -->
<element name="userRole" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__loginByUserPasswordKeyOutput::userRole -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="loginBySessionKey">
<complexType>
<sequence>
<element name="sessionID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKey::sessionID -->
<element name="appKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKey::appKey -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="loginBySessionKeyOutput">
<complexType>
<sequence>
<element name="userCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__loginBySessionKeyOutput::userCode -->
<element name="degreeTypeCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__loginBySessionKeyOutput::degreeTypeCode -->
<element name="degreeCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__loginBySessionKeyOutput::degreeCode -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__loginBySessionKeyOutput::courseCode -->
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::wsKey -->
<element name="userNickname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::userNickname -->
<element name="userID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::userID -->
<element name="userSurname1" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::userSurname1 -->
<element name="userSurname2" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::userSurname2 -->
<element name="userFirstname" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::userFirstname -->
<element name="userPhoto" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::userPhoto -->
<element name="userBirthday" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::userBirthday -->
<element name="userRole" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__loginBySessionKeyOutput::userRole -->
<element name="degreeTypeName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::degreeTypeName -->
<element name="degreeName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::degreeName -->
<element name="courseName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__loginBySessionKeyOutput::courseName -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getNewPassword">
<complexType>
<sequence>
<element name="userID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getNewPassword::userID -->
<element name="appKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getNewPassword::appKey -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getNewPasswordOutput">
<complexType>
<sequence>
<element name="success" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getNewPasswordOutput::success -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getCourses">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getCourses::wsKey -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getCoursesOutput">
<complexType>
<sequence>
<element name="numCourses" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getCoursesOutput::numCourses -->
<element name="coursesArray" type="swad:coursesArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getCoursesOutput::coursesArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getCourseInfo">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getCourseInfo::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getCourseInfo::courseCode -->
<element name="infoType" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getCourseInfo::infoType -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getCourseInfoOutput">
<complexType>
<sequence>
<element name="infoSrc" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getCourseInfoOutput::infoSrc -->
<element name="infoTxt" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getCourseInfoOutput::infoTxt -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getGroupTypes">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getGroupTypes::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getGroupTypes::courseCode -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getGroupTypesOutput">
<complexType>
<sequence>
<element name="numGroupTypes" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getGroupTypesOutput::numGroupTypes -->
<element name="groupTypesArray" type="swad:groupTypesArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getGroupTypesOutput::groupTypesArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getGroups">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getGroups::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getGroups::courseCode -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getGroupsOutput">
<complexType>
<sequence>
<element name="numGroups" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getGroupsOutput::numGroups -->
<element name="groupsArray" type="swad:groupsArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getGroupsOutput::groupsArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="sendMyGroups">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendMyGroups::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendMyGroups::courseCode -->
<element name="myGroups" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendMyGroups::myGroups -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="sendMyGroupsOutput">
<complexType>
<sequence>
<element name="success" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendMyGroupsOutput::success -->
<element name="numGroups" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendMyGroupsOutput::numGroups -->
<element name="groupsArray" type="swad:groupsArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__sendMyGroupsOutput::groupsArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getDirectoryTree">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getDirectoryTree::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getDirectoryTree::courseCode -->
<element name="groupCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getDirectoryTree::groupCode -->
<element name="treeCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getDirectoryTree::treeCode -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getDirectoryTreeOutput">
<complexType>
<sequence>
<element name="tree" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getDirectoryTreeOutput::tree -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getFile">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getFile::wsKey -->
<element name="fileCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getFile::fileCode -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getFileOutput">
<complexType>
<sequence>
<element name="fileName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getFileOutput::fileName -->
<element name="URL" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getFileOutput::URL -->
<element name="size" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getFileOutput::size -->
<element name="time" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getFileOutput::time -->
<element name="license" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getFileOutput::license -->
<element name="publisherName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getFileOutput::publisherName -->
<element name="publisherPhoto" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getFileOutput::publisherPhoto -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getMarks">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getMarks::wsKey -->
<element name="fileCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getMarks::fileCode -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getMarksOutput">
<complexType>
<sequence>
<element name="content" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getMarksOutput::content -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getTestConfig">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getTestConfig::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getTestConfig::courseCode -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getTestConfigOutput">
<complexType>
<sequence>
<element name="pluggable" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getTestConfigOutput::pluggable -->
<element name="numQuestions" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getTestConfigOutput::numQuestions -->
<element name="minQuestions" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getTestConfigOutput::minQuestions -->
<element name="defQuestions" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getTestConfigOutput::defQuestions -->
<element name="maxQuestions" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getTestConfigOutput::maxQuestions -->
<element name="feedback" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getTestConfigOutput::feedback -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getTests">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getTests::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getTests::courseCode -->
<element name="beginTime" type="xsd:long" minOccurs="1" maxOccurs="1"/><!-- swad__getTests::beginTime -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getTestsOutput">
<complexType>
<sequence>
<element name="tagsArray" type="swad:tagsArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getTestsOutput::tagsArray -->
<element name="questionsArray" type="swad:questionsArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getTestsOutput::questionsArray -->
<element name="answersArray" type="swad:answersArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getTestsOutput::answersArray -->
<element name="questionTagsArray" type="swad:questionTagsArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getTestsOutput::questionTagsArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getUsers">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getUsers::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getUsers::courseCode -->
<element name="groupCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getUsers::groupCode -->
<element name="userRole" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getUsers::userRole -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getUsersOutput">
<complexType>
<sequence>
<element name="numUsers" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getUsersOutput::numUsers -->
<element name="usersArray" type="swad:usersArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getUsersOutput::usersArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getAttendanceEvents">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getAttendanceEvents::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getAttendanceEvents::courseCode -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getAttendanceEventsOutput">
<complexType>
<sequence>
<element name="numEvents" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getAttendanceEventsOutput::numEvents -->
<element name="eventsArray" type="swad:attendanceEventsArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getAttendanceEventsOutput::eventsArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="sendAttendanceEvent">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendAttendanceEvent::wsKey -->
<element name="attendanceEventCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceEvent::attendanceEventCode -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceEvent::courseCode -->
<element name="hidden" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceEvent::hidden -->
<element name="startTime" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceEvent::startTime -->
<element name="endTime" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceEvent::endTime -->
<element name="commentsTeachersVisible" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceEvent::commentsTeachersVisible -->
<element name="title" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendAttendanceEvent::title -->
<element name="text" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendAttendanceEvent::text -->
<element name="groups" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendAttendanceEvent::groups -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="sendAttendanceEventOutput">
<complexType>
<sequence>
<element name="attendanceEventCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceEventOutput::attendanceEventCode -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getAttendanceUsers">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getAttendanceUsers::wsKey -->
<element name="attendanceEventCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getAttendanceUsers::attendanceEventCode -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getAttendanceUsersOutput">
<complexType>
<sequence>
<element name="numUsers" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getAttendanceUsersOutput::numUsers -->
<element name="usersArray" type="swad:attendanceUsersArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getAttendanceUsersOutput::usersArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="sendAttendanceUsers">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendAttendanceUsers::wsKey -->
<element name="attendanceEventCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceUsers::attendanceEventCode -->
<element name="users" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendAttendanceUsers::users -->
<element name="setOthersAsAbsent" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceUsers::setOthersAsAbsent -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="sendAttendanceUsersOutput">
<complexType>
<sequence>
<element name="success" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceUsersOutput::success -->
<element name="numUsers" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendAttendanceUsersOutput::numUsers -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="getNotifications">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__getNotifications::wsKey -->
<element name="beginTime" type="xsd:long" minOccurs="1" maxOccurs="1"/><!-- swad__getNotifications::beginTime -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getNotificationsOutput">
<complexType>
<sequence>
<element name="numNotifications" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__getNotificationsOutput::numNotifications -->
<element name="notificationsArray" type="swad:notificationsArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__getNotificationsOutput::notificationsArray -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="markNotificationsAsRead">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__markNotificationsAsRead::wsKey -->
<element name="notifications" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__markNotificationsAsRead::notifications -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="markNotificationsAsReadOutput">
<complexType>
<sequence>
<element name="numNotifications" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__markNotificationsAsReadOutput::numNotifications -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="sendNotice">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendNotice::wsKey -->
<element name="courseCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendNotice::courseCode -->
<element name="body" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendNotice::body -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="sendNoticeOutput">
<complexType>
<sequence>
<element name="noticeCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendNoticeOutput::noticeCode -->
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="sendMessage">
<complexType>
<sequence>
<element name="wsKey" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendMessage::wsKey -->
<element name="messageCode" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendMessage::messageCode -->
<element name="to" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendMessage::to -->
<element name="subject" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendMessage::subject -->
<element name="body" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/><!-- swad__sendMessage::body -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="sendMessageOutput">
<complexType>
<sequence>
<element name="numUsers" type="xsd:int" minOccurs="1" maxOccurs="1"/><!-- swad__sendMessageOutput::numUsers -->
<element name="usersArray" type="swad:usersArray" minOccurs="1" maxOccurs="1" nillable="true"/><!-- swad__sendMessageOutput::usersArray -->
</sequence>
</complexType>
</element>
</schema>

View File

@ -2206,7 +2206,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActLogOut */{ 10,-1,TabPrf,ActFrmLogIn ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,Ses_CloseSession ,Usr_Logout ,NULL},
/* ActAnnSee */{1234,-1,TabPrf,ActFrmLogIn ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ann_MarkAnnouncementAsSeen ,NULL},
/* ActChgMyRol */{ 589,-1,TabPrf,ActFrmLogIn ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Usr_ChangeMyRole ,Usr_ShowFormsRoleAndLogout ,NULL},
/* ActChgMyRol */{ 589,-1,TabPrf,ActFrmLogIn ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Rol_ChangeMyRole ,Usr_ShowFormsRoleAndLogout ,NULL},
/* ActCreUsrAcc */{1163,-1,TabPrf,ActFrmUsrAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AfterCreationNewAccount ,NULL},

View File

@ -352,7 +352,7 @@ void Ann_ShowFormAnnouncement (void)
"<td align=\"right\" valign=\"top\" class=\"TIT_TBL\">%s: </td>"
"<td align=\"left\" valign=\"middle\" class=\"DAT\">",
Txt_Users);
Usr_WriteSelectorRoles (1 << Rol_ROLE_STUDENT |
Rol_WriteSelectorRoles (1 << Rol_ROLE_STUDENT |
1 << Rol_ROLE_TEACHER);
fprintf (Gbl.F.Out,"</td>"
"</tr>"
@ -383,7 +383,7 @@ void Ann_ReceiveAnnouncement (void)
Str_TO_RIGOROUS_HTML,true);
/* Get users who can view this announcement */
Usr_GetSelectedRoles (&Roles);
Rol_GetSelectedRoles (&Roles);
/***** Create a new announcement in database *****/
Ann_CreateAnnouncement (Roles,Subject,Content);

View File

@ -35,12 +35,16 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.35 (2014/12/12)"
#define Log_PLATFORM_VERSION "SWAD 14.36 (2014/12/12)"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1
/*
Version 14.36 :Dic 12, 2014 New module swad_role for user's roles. (170764 lines)
1 change necessary in Makefile:
Add swad_role.o to list of object files
Version 14.35 :Dic 12, 2014 New MIME type, suggested by Benito Palacios.
New module swad_enrollment for enrollment (registration) or removing of users. (170725 lines)
1 change necessary in Makefile:

View File

@ -221,7 +221,7 @@ void Con_GetAndShowLastClicks (void)
"</tr>",
ClassRow,row[0],
ClassRow,row[2],
ClassRow,Txt_ROLES_SINGULAR_Abc[Usr_ConvertUnsignedStrToRole (row[3])][Usr_SEX_UNKNOWN],
ClassRow,Txt_ROLES_SINGULAR_Abc[Rol_ConvertUnsignedStrToRole (row[3])][Usr_SEX_UNKNOWN],
ClassRow,Deg.ShortName,
ClassRow,row[5]);
}

View File

@ -102,8 +102,6 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe);
static bool Enr_CheckIfICanEliminateAccount (bool ItsMe);
static void Enr_PutLinkToRemoveMyAccount (void);
static void Enr_PutActionsRegRemSeveralUsrs (void);
static void Enr_PutAllRolesRegRemUsrsCrs (void);
static void Enr_PutOneRoleRegRemUsrsCrs (Rol_Role_t Role,bool Checked);
static void Enr_RegisterUsr (struct UsrData *UsrDat,Rol_Role_t RegRemRole,
struct ListCodGrps *LstGrps,unsigned *NumUsrsRegistered);
@ -118,6 +116,7 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods);
static void Enr_ShowFormToEditOtherUsr (void);
static void Enr_RegisterAdminInCurrentDeg (struct UsrData *UsrDat);
static void Enr_ReqRemAdmOfDeg (void);
static void Enr_ReqRemOrRemAdm (Enr_ReqDelOrDelUsr_t ReqDelOrDelUsr);
@ -127,7 +126,6 @@ static void Enr_ReqAddAdmOfDeg (void);
static void Enr_CreateNewEncryptedUsrCod (struct UsrData *UsrDat);
static void Enr_FilterUsrDat (struct UsrData *UsrDat);
static void Enr_RegisterAdminInCurrentDeg (struct UsrData *UsrDat);
static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,struct Course *Crs,
Enr_RemoveUsrWorks_t RemoveUsrWorks,Cns_QuietOrVerbose_t QuietOrVerbose);
static void Enr_EffectivelyRemAdmFromDeg (struct UsrData *UsrDat);
@ -135,10 +133,48 @@ static void Enr_DeleteUsrFromPlatform (struct UsrData *UsrDat,
Cns_QuietOrVerbose_t QuietOrVerbose);
static void Enr_RemoveUsr (struct UsrData *UsrDat);
static void Enr_ModifyRoleInCurrentCrs (struct UsrData *UsrDat,
Rol_Role_t NewRole,
Cns_QuietOrVerbose_t QuietOrVerbose,
Enr_KeepOrSetAccepted_t KeepOrSetAccepted);
/*****************************************************************************/
/***************** Modify the role of a user in a course *********************/
/*****************************************************************************/
void Enr_ModifyRoleInCurrentCrs (struct UsrData *UsrDat,
Rol_Role_t NewRole,
Cns_QuietOrVerbose_t QuietOrVerbose)
{
extern const char *Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B;
extern const char *Txt_ROLES_SINGULAR_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
char Query[256];
Rol_Role_t OldRole;
/***** Change user's role if different *****/
OldRole = Rol_GetRoleInCrs (Gbl.CurrentCrs.Crs.CrsCod,UsrDat->UsrCod);
if (NewRole != OldRole) // The role must be updated
{
/***** Check if user's role is allowed *****/
if (!(NewRole == Rol_ROLE_STUDENT ||
NewRole == Rol_ROLE_TEACHER))
Lay_ShowErrorAndExit ("Wrong role.");
/***** Update the role of a user in a course *****/
sprintf (Query,"UPDATE crs_usr SET Role='%u'"
" WHERE CrsCod='%ld' AND UsrCod='%ld'",
(unsigned) NewRole,Gbl.CurrentCrs.Crs.CrsCod,UsrDat->UsrCod);
DB_QueryUPDATE (Query,"can not modify user's role in course");
/***** Show info message *****/
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
UsrDat->FullName,Gbl.CurrentCrs.Crs.FullName,
Txt_ROLES_SINGULAR_abc[OldRole][UsrDat->Sex],
Txt_ROLES_SINGULAR_abc[NewRole][UsrDat->Sex]);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
}
UsrDat->RoleInCurrentCrsDB = NewRole;
UsrDat->Roles |= (1 << NewRole);
}
}
/*****************************************************************************/
/*********************** Register user in current course *********************/
@ -205,34 +241,6 @@ void Enr_RegisterUsrInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole,
}
}
/*****************************************************************************/
/******************* Register administrator in current degree ****************/
/*****************************************************************************/
static void Enr_RegisterAdminInCurrentDeg (struct UsrData *UsrDat)
{
extern const char *Txt_THE_USER_X_is_already_an_administrator_of_the_degree_Y;
extern const char *Txt_THE_USER_X_has_been_enrolled_as_administrator_of_the_degree_Y;
char Query[512];
/***** Check if user was and administrator of current degree *****/
if (Usr_CheckIfUsrIsAdmOfDeg (UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod))
sprintf (Gbl.Message,Txt_THE_USER_X_is_already_an_administrator_of_the_degree_Y,
UsrDat->FullName,Gbl.CurrentDeg.Deg.FullName);
else // User was not administrator of current degree
{
/***** Insert or replace administrator in current degree *****/
sprintf (Query,"REPLACE INTO deg_admin (UsrCod,DegCod)"
" VALUES ('%ld','%ld')",
UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod);
DB_QueryREPLACE (Query,"can not create administrator of degree");
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_enrolled_as_administrator_of_the_degree_Y,
UsrDat->FullName,Gbl.CurrentDeg.Deg.FullName);
}
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
}
/*****************************************************************************/
/************************ Remove a user from a course ************************/
/*****************************************************************************/
@ -950,7 +958,7 @@ void Enr_GetNotifEnrollment (char *SummaryStr,
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
/* Role (row[0]) */
Role = Usr_ConvertUnsignedStrToRole (row[0]);
Role = Rol_ConvertUnsignedStrToRole (row[0]);
strcpy (SummaryStr,Txt_ROLES_SINGULAR_Abc[Role][UsrDat.Sex]);
if (MaxChars)
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
@ -1212,7 +1220,7 @@ void Enr_ShowFormRegRemSeveralUsrs (void)
The_ClassTitle[Gbl.Prefs.Theme],
Txt_Step_2_Select_the_type_of_user_to_register_remove);
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
Enr_PutAllRolesRegRemUsrsCrs ();
Rol_PutAllRolesRegRemUsrsCrs ();
/***** Step 3: Put different actions to register/remove students to/from current course *****/
fprintf (Gbl.F.Out,"<div align=\"left\" class=\"%s\">"
@ -1650,50 +1658,6 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
"</div>");
}
/*****************************************************************************/
/*** Select types of user to register/remove users to/from current course ****/
/*****************************************************************************/
static void Enr_PutAllRolesRegRemUsrsCrs (void)
{
extern const char *The_ClassFormul[The_NUM_THEMES];
/***** Students or teachers *****/
fprintf (Gbl.F.Out,"<div style=\"display:inline-block; margin:0 auto;\">"
"<ul style=\"list-style-type:none; text-align:left;\" class=\"%s\">",
The_ClassFormul[Gbl.Prefs.Theme]);
Enr_PutOneRoleRegRemUsrsCrs (Rol_ROLE_STUDENT,true);
Enr_PutOneRoleRegRemUsrsCrs (Rol_ROLE_TEACHER,false);
fprintf (Gbl.F.Out,"</ul>"
"</div>");
}
/*****************************************************************************/
/*** Select types of user to register/remove users to/from current course ****/
/*****************************************************************************/
static void Enr_PutOneRoleRegRemUsrsCrs (Rol_Role_t Role,bool Checked)
{
extern const char *Txt_ROLES_SINGULAR_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
fprintf (Gbl.F.Out,"<li>"
"<input type=\"radio\" name=\"RegRemRole\" value=\"%u\"",
(unsigned) Role);
if (Checked)
fprintf (Gbl.F.Out," checked=\"checked\"");
switch (Gbl.Usrs.Me.LoggedRole) // Can I select type of user?
{
case Rol_ROLE_DEG_ADMIN:
case Rol_ROLE_SUPERUSER: // Yes, I can
break;
default: // No, I can not
fprintf (Gbl.F.Out," disabled=\"disabled\"");
break;
}
fprintf (Gbl.F.Out," />%s</li>",
Txt_ROLES_SINGULAR_Abc[Role][Usr_SEX_UNKNOWN]);
}
/*****************************************************************************/
/******* Receive the list of users of the course to register/remove **********/
/*****************************************************************************/
@ -1748,7 +1712,7 @@ void Enr_ReceiveFormUsrsCrs (void)
/***** Get the type of user to register / remove *****/
Par_GetParToText ("RegRemRole",UnsignedStr,1);
if (UnsignedStr[0])
switch ((RegRemRole = Usr_ConvertUnsignedStrToRole (UnsignedStr)))
switch ((RegRemRole = Rol_ConvertUnsignedStrToRole (UnsignedStr)))
{
case Rol_ROLE_STUDENT:
break;
@ -2222,11 +2186,10 @@ static void Enr_RegisterUsr (struct UsrData *UsrDat,Rol_Role_t RegRemRole,
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
{
if (Usr_CheckIfUsrBelongsToCrs (UsrDat->UsrCod,Gbl.CurrentCrs.Crs.CrsCod)) // User does belong to current course, modify his/her role
Enr_ModifyRoleInCurrentCrs (UsrDat,RegRemRole,
Cns_QUIET,Enr_SET_ACCEPTED_TO_FALSE);
Enr_ModifyRoleInCurrentCrs (UsrDat,RegRemRole,Cns_QUIET);
else
Enr_RegisterUsrInCurrentCrs (UsrDat,RegRemRole,
Cns_QUIET,Enr_SET_ACCEPTED_TO_FALSE);
Enr_RegisterUsrInCurrentCrs (UsrDat,RegRemRole,Cns_QUIET,
Enr_SET_ACCEPTED_TO_FALSE);
/***** Register user in the selected groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps) // If there are groups in the course
@ -2456,7 +2419,7 @@ void Enr_SignUpInCrs (void)
{
/***** Get new role from record form *****/
Par_GetParToText ("Role",UnsignedStr,10);
RoleFromForm = Usr_ConvertUnsignedStrToRole (UnsignedStr);
RoleFromForm = Rol_ConvertUnsignedStrToRole (UnsignedStr);
/* Check if role is correct */
if (!(RoleFromForm == Rol_ROLE_STUDENT ||
@ -2556,7 +2519,7 @@ void Enr_GetNotifEnrollmentRequest (char *SummaryStr,char **ContentStr,
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
/* Role (row[1]) */
DesiredRole = Usr_ConvertUnsignedStrToRole (row[1]);
DesiredRole = Rol_ConvertUnsignedStrToRole (row[1]);
strcpy (SummaryStr,Txt_ROLES_SINGULAR_Abc[DesiredRole][UsrDat.Sex]);
if (MaxChars)
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
@ -2741,7 +2704,7 @@ void Enr_ShowEnrollmentRequests (void)
"<td align=\"right\" valign=\"top\" class=\"%s\">%s:</td>"
"<td align=\"left\" valign=\"middle\" class=\"DAT\">",
The_ClassFormul[Gbl.Prefs.Theme],Txt_Users);
Usr_GetSelectedRoles (&Roles);
Rol_GetSelectedRoles (&Roles);
if (!Roles)
/* Set default roles */
switch (Gbl.Usrs.Me.LoggedRole)
@ -2757,7 +2720,7 @@ void Enr_ShowEnrollmentRequests (void)
Lay_ShowErrorAndExit ("You don't have permission to list requesters.");
break;
}
Usr_WriteSelectorRoles (Roles);
Rol_WriteSelectorRoles (Roles);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
/* Form end */
@ -3046,7 +3009,7 @@ void Enr_ShowEnrollmentRequests (void)
Usr_RestrictLengthAndWriteName (&UsrDat,20);
/***** Requested role (row[3]) *****/
DesiredRole = Usr_ConvertUnsignedStrToRole (row[3]);
DesiredRole = Rol_ConvertUnsignedStrToRole (row[3]);
fprintf (Gbl.F.Out,"<td align=\"left\" valign=\"top\" class=\"DAT\">%s</td>",
Txt_ROLES_SINGULAR_abc[DesiredRole][UsrDat.Sex]);
@ -3144,7 +3107,7 @@ Rol_Role_t Enr_GetRequestedRole (long UsrCod)
{
/***** Get role *****/
row = mysql_fetch_row (mysql_res);
Role = Usr_ConvertUnsignedStrToRole (row[0]);
Role = Rol_ConvertUnsignedStrToRole (row[0]);
}
/***** Free structure that stores the query result *****/
@ -3432,6 +3395,34 @@ void Enr_AddAdmToDeg (void)
}
}
/*****************************************************************************/
/******************* Register administrator in current degree ****************/
/*****************************************************************************/
static void Enr_RegisterAdminInCurrentDeg (struct UsrData *UsrDat)
{
extern const char *Txt_THE_USER_X_is_already_an_administrator_of_the_degree_Y;
extern const char *Txt_THE_USER_X_has_been_enrolled_as_administrator_of_the_degree_Y;
char Query[512];
/***** Check if user was and administrator of current degree *****/
if (Usr_CheckIfUsrIsAdmOfDeg (UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod))
sprintf (Gbl.Message,Txt_THE_USER_X_is_already_an_administrator_of_the_degree_Y,
UsrDat->FullName,Gbl.CurrentDeg.Deg.FullName);
else // User was not administrator of current degree
{
/***** Insert or replace administrator in current degree *****/
sprintf (Query,"REPLACE INTO deg_admin (UsrCod,DegCod)"
" VALUES ('%ld','%ld')",
UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod);
DB_QueryREPLACE (Query,"can not create administrator of degree");
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_enrolled_as_administrator_of_the_degree_Y,
UsrDat->FullName,Gbl.CurrentDeg.Deg.FullName);
}
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
}
/*****************************************************************************/
/****************** Ask for remove me from current course ********************/
/*****************************************************************************/
@ -3826,11 +3817,10 @@ void Enr_CreatAndShowNewUsrRecordAndRegInCrs (void)
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
{
if (Usr_CheckIfUsrBelongsToCrs (Gbl.Usrs.Other.UsrDat.UsrCod,Gbl.CurrentCrs.Crs.CrsCod)) // User does belong to current course, modify his/her role
Enr_ModifyRoleInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,
Cns_VERBOSE,Enr_SET_ACCEPTED_TO_FALSE);
Enr_ModifyRoleInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,Cns_VERBOSE);
else
Enr_RegisterUsrInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,
Cns_VERBOSE,Enr_SET_ACCEPTED_TO_FALSE);
Enr_RegisterUsrInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,Cns_VERBOSE,
Enr_SET_ACCEPTED_TO_FALSE);
/***** Change user's groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups?
@ -3899,11 +3889,10 @@ void Enr_ModifAndShowUsrCardAndRegInCrsAndGrps (void)
/***** Register user in current course in database *****/
if (Usr_CheckIfUsrBelongsToCrs (Gbl.Usrs.Other.UsrDat.UsrCod,Gbl.CurrentCrs.Crs.CrsCod)) // User does belong to current course, modify his/her role
Enr_ModifyRoleInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,
Cns_VERBOSE,Enr_SET_ACCEPTED_TO_FALSE);
Enr_ModifyRoleInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,Cns_VERBOSE);
else
Enr_RegisterUsrInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,
Cns_VERBOSE,Enr_SET_ACCEPTED_TO_FALSE);
Enr_RegisterUsrInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,Cns_VERBOSE,
Enr_SET_ACCEPTED_TO_FALSE);
/***** Change user's groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups?
@ -3962,54 +3951,6 @@ void Enr_ModifAndShowUsrCardAndRegInCrsAndGrps (void)
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
/*****************************************************************************/
/***************** Modify the role of a user in a course *********************/
/*****************************************************************************/
static void Enr_ModifyRoleInCurrentCrs (struct UsrData *UsrDat,
Rol_Role_t NewRole,
Cns_QuietOrVerbose_t QuietOrVerbose,
Enr_KeepOrSetAccepted_t KeepOrSetAccepted)
{
extern const char *Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B;
extern const char *Txt_ROLES_SINGULAR_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
char Query[256];
Rol_Role_t OldRole;
/***** Change user's role if different *****/
OldRole = Usr_GetRoleInCrs (Gbl.CurrentCrs.Crs.CrsCod,UsrDat->UsrCod);
if (NewRole != OldRole) // The role must be updated
{
/***** Check if user's role is allowed *****/
if (!(NewRole == Rol_ROLE_STUDENT ||
NewRole == Rol_ROLE_TEACHER))
Lay_ShowErrorAndExit ("Wrong role.");
/***** Update the role of a user in a course *****/
sprintf (Query,"UPDATE crs_usr SET Role='%u'"
" WHERE CrsCod='%ld' AND UsrCod='%ld'",
(unsigned) NewRole,Gbl.CurrentCrs.Crs.CrsCod,UsrDat->UsrCod);
DB_QueryUPDATE (Query,"can not modify user's role in course");
/***** Show info message *****/
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
UsrDat->FullName,Gbl.CurrentCrs.Crs.FullName,
Txt_ROLES_SINGULAR_abc[OldRole][UsrDat->Sex],
Txt_ROLES_SINGULAR_abc[NewRole][UsrDat->Sex]);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
}
UsrDat->RoleInCurrentCrsDB = NewRole;
UsrDat->Roles |= (1 << NewRole);
}
/***** Set user's acceptation to true in the current course *****/
if (KeepOrSetAccepted == Enr_SET_ACCEPTED_TO_TRUE)
Enr_AcceptUsrInCrs (UsrDat->UsrCod); // Confirm user enrollment
}
/*****************************************************************************/
/********* Set a user's acceptation to true in the current course ************/
/*****************************************************************************/

View File

@ -59,6 +59,13 @@ typedef enum
/****************************** Public prototypes ****************************/
/*****************************************************************************/
void Enr_ModifyRoleInCurrentCrs (struct UsrData *UsrDat,
Rol_Role_t NewRole,
Cns_QuietOrVerbose_t QuietOrVerbose);
void Enr_RegisterUsrInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole,
Cns_QuietOrVerbose_t QuietOrVerbose,
Enr_KeepOrSetAccepted_t KeepOrSetAccepted);
void Enr_RemoveUsrFromTableClicksWithoutPhoto (long UsrCod);
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction);
@ -78,9 +85,7 @@ void Enr_GetNotifEnrollment (char *SummaryStr,
void Enr_CreateNewUsr (struct UsrData *UsrDat);
void Enr_UpdateUsrData (struct UsrData *UsrDat);
void Enr_UpdateInstitutionCentreDepartment (void);
void Enr_RegisterUsrInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole,
Cns_QuietOrVerbose_t QuietOrVerbose,
Enr_KeepOrSetAccepted_t KeepOrSetAccepted);
bool Enr_CreateNewAccountAndLogIn (void);
void Enr_RemoveUsrBriefcase (struct UsrData *UsrDat);

View File

@ -1468,35 +1468,35 @@ void For_SetForumTypeAndRestrictAccess (void)
{
case For_FORUM_COURSE_USRS:
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyRoleInCrs (Gbl.Forum.Crs.CrsCod) >= Rol_ROLE_STUDENT);
Rol_GetMyRoleInCrs (Gbl.Forum.Crs.CrsCod) >= Rol_ROLE_STUDENT);
break;
case For_FORUM_COURSE_TCHS:
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyRoleInCrs (Gbl.Forum.Crs.CrsCod) >= Rol_ROLE_TEACHER);
Rol_GetMyRoleInCrs (Gbl.Forum.Crs.CrsCod) >= Rol_ROLE_TEACHER);
break;
case For_FORUM_DEGREE_USRS:
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInDeg (Gbl.Forum.Deg.DegCod) >= Rol_ROLE_STUDENT);
Rol_GetMyMaxRoleInDeg (Gbl.Forum.Deg.DegCod) >= Rol_ROLE_STUDENT);
break;
case For_FORUM_DEGREE_TCHS:
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInDeg (Gbl.Forum.Deg.DegCod) >= Rol_ROLE_TEACHER);
Rol_GetMyMaxRoleInDeg (Gbl.Forum.Deg.DegCod) >= Rol_ROLE_TEACHER);
break;
case For_FORUM_CENTRE_USRS:
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInCtr (Gbl.Forum.Ctr.CtrCod) >= Rol_ROLE_STUDENT);
Rol_GetMyMaxRoleInCtr (Gbl.Forum.Ctr.CtrCod) >= Rol_ROLE_STUDENT);
break;
case For_FORUM_CENTRE_TCHS:
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInCtr (Gbl.Forum.Ctr.CtrCod) >= Rol_ROLE_TEACHER);
Rol_GetMyMaxRoleInCtr (Gbl.Forum.Ctr.CtrCod) >= Rol_ROLE_TEACHER);
break;
case For_FORUM_INSTITUTION_USRS:
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInIns (Gbl.Forum.Ins.InsCod) >= Rol_ROLE_STUDENT);
Rol_GetMyMaxRoleInIns (Gbl.Forum.Ins.InsCod) >= Rol_ROLE_STUDENT);
break;
case For_FORUM_INSTITUTION_TCHS:
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInIns (Gbl.Forum.Ins.InsCod) >= Rol_ROLE_TEACHER);
Rol_GetMyMaxRoleInIns (Gbl.Forum.Ins.InsCod) >= Rol_ROLE_TEACHER);
break;
case For_FORUM_GLOBAL_USRS:
case For_FORUM_SWAD_USRS:
@ -1775,7 +1775,7 @@ static long For_WriteLinksToInsForums (long InsCod,bool IsLastIns,bool IsLastIte
if (InsCod > 0)
{
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInIns (InsCod) >= Rol_ROLE_TEACHER);
Rol_GetMyMaxRoleInIns (InsCod) >= Rol_ROLE_TEACHER);
/***** Get data of this institution *****/
Gbl.Forum.Ins.InsCod = InsCod;
@ -1808,7 +1808,7 @@ static long For_WriteLinksToCtrForums (long CtrCod,bool IsLastCtr,bool IsLastIte
if (CtrCod > 0)
{
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInCtr (CtrCod) >= Rol_ROLE_TEACHER);
Rol_GetMyMaxRoleInCtr (CtrCod) >= Rol_ROLE_TEACHER);
/***** Get data of this degree *****/
Gbl.Forum.Ctr.CtrCod = CtrCod;
@ -1841,7 +1841,7 @@ static long For_WriteLinksToDegForums (long DegCod,bool IsLastDeg,bool IsLastIte
if (DegCod > 0)
{
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyMaxRoleInDeg (DegCod) >= Rol_ROLE_TEACHER);
Rol_GetMyMaxRoleInDeg (DegCod) >= Rol_ROLE_TEACHER);
/***** Get data of this degree *****/
Gbl.Forum.Deg.DegCod = DegCod;
@ -1874,7 +1874,7 @@ static long For_WriteLinksToCrsForums (long CrsCod,bool IsLastCrs,bool IsLastIte
if (CrsCod > 0)
{
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
Usr_GetMyRoleInCrs (CrsCod) >= Rol_ROLE_TEACHER);
Rol_GetMyRoleInCrs (CrsCod) >= Rol_ROLE_TEACHER);
/***** Get data of this course *****/
Gbl.Forum.Crs.CrsCod = CrsCod;

View File

@ -2814,7 +2814,7 @@ Rol_Role_t Rec_GetRoleFromRecordForm (void)
/***** Get role as a parameter from form *****/
Par_GetParToText ("Role",UnsignedStr,10);
Role = Usr_ConvertUnsignedStrToRole (UnsignedStr);
Role = Rol_ConvertUnsignedStrToRole (UnsignedStr);
/***** Check if I can register a user
with the received role in current course *****/

435
swad_role.c Normal file
View File

@ -0,0 +1,435 @@
// swad_role.c: user's roles
/*
SWAD (Shared Workspace At a Distance),
is a web platform developed at the University of Granada (Spain),
and used to support university teaching.
This file is part of SWAD core.
Copyright (C) 1999-2014 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************/
/*********************************** Headers *********************************/
/*****************************************************************************/
#include "swad_database.h"
#include "swad_global.h"
#include "swad_parameter.h"
#include "swad_role.h"
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
/*****************************************************************************/
/***************************** Private constants *****************************/
/*****************************************************************************/
/*****************************************************************************/
/****************************** Internal types *******************************/
/*****************************************************************************/
/*****************************************************************************/
/************** External global variables from others modules ****************/
/*****************************************************************************/
extern struct Globals Gbl;
/*****************************************************************************/
/************************* Internal global variables *************************/
/*****************************************************************************/
/*****************************************************************************/
/***************************** Private prototypes ****************************/
/*****************************************************************************/
static void Rol_PutOneRoleRegRemUsrsCrs (Rol_Role_t Role,bool Checked);
/*****************************************************************************/
/****************** Get number of available roles for me *********************/
/*****************************************************************************/
unsigned Rol_GetNumAvailableRoles (void)
{
Rol_Role_t Role;
unsigned NumAvailableRoles = 0;
for (Role = Rol_ROLE_GUEST;
Role < Rol_NUM_ROLES;
Role++)
if (Gbl.Usrs.Me.AvailableRoles & (1 << Role))
NumAvailableRoles++;
return NumAvailableRoles;
}
/*****************************************************************************/
/************ Get maximum role of a user in all his/her courses **************/
/*****************************************************************************/
Rol_Role_t Rol_GetMaxRole (unsigned Roles)
{
if (Roles & (1 << Rol_ROLE_TEACHER))
return Rol_ROLE_TEACHER;
if (Roles & (1 << Rol_ROLE_STUDENT))
return Rol_ROLE_STUDENT;
return Rol_ROLE_GUEST;
}
/*****************************************************************************/
/******************* Get my maximum role in a institution ********************/
/*****************************************************************************/
Rol_Role_t Rol_GetMyMaxRoleInIns (long InsCod)
{
unsigned NumMyIns;
if (InsCod > 0)
{
/***** Fill the list with the institutions I belong to (if not already filled) *****/
Usr_GetMyInstitutions ();
/***** Check if the institution passed as parameter is any of my institutions *****/
for (NumMyIns = 0;
NumMyIns < Gbl.Usrs.Me.MyInstitutions.Num;
NumMyIns++)
if (Gbl.Usrs.Me.MyInstitutions.Inss[NumMyIns].InsCod == InsCod)
return Gbl.Usrs.Me.MyInstitutions.Inss[NumMyIns].MaxRole;
return Rol_ROLE_GUEST;
}
return Rol_ROLE_UNKNOWN; // No degree
}
/*****************************************************************************/
/********************** Get my maximum role in a centre **********************/
/*****************************************************************************/
Rol_Role_t Rol_GetMyMaxRoleInCtr (long CtrCod)
{
unsigned NumMyCtr;
if (CtrCod > 0)
{
/***** Fill the list with the centres I belong to (if not already filled) *****/
Usr_GetMyCentres ();
/***** Check if the centre passed as parameter is any of my centres *****/
for (NumMyCtr = 0;
NumMyCtr < Gbl.Usrs.Me.MyCentres.Num;
NumMyCtr++)
if (Gbl.Usrs.Me.MyCentres.Ctrs[NumMyCtr].CtrCod == CtrCod)
return Gbl.Usrs.Me.MyCentres.Ctrs[NumMyCtr].MaxRole;
return Rol_ROLE_GUEST;
}
return Rol_ROLE_UNKNOWN; // No centre
}
/*****************************************************************************/
/********************** Get my maximum role in a degree **********************/
/*****************************************************************************/
Rol_Role_t Rol_GetMyMaxRoleInDeg (long DegCod)
{
unsigned NumMyDeg;
if (DegCod > 0)
{
/***** Fill the list with the degrees I belong to (if not already filled) *****/
Usr_GetMyDegrees ();
/***** Check if the degree passed as parameter is any of my degrees *****/
for (NumMyDeg = 0;
NumMyDeg < Gbl.Usrs.Me.MyDegrees.Num;
NumMyDeg++)
if (Gbl.Usrs.Me.MyDegrees.Degs[NumMyDeg].DegCod == DegCod)
return Gbl.Usrs.Me.MyDegrees.Degs[NumMyDeg].MaxRole;
return Rol_ROLE_GUEST;
}
return Rol_ROLE_UNKNOWN; // No degree
}
/*****************************************************************************/
/*************************** Get my role in a course *************************/
/*****************************************************************************/
Rol_Role_t Rol_GetMyRoleInCrs (long CrsCod)
{
unsigned NumMyCrs;
if (CrsCod > 0)
{
/***** Fill the list with the courses I belong to (if not already filled) *****/
Usr_GetMyCourses ();
/***** Check if the course passed as parameter is any of my courses *****/
for (NumMyCrs = 0;
NumMyCrs < Gbl.Usrs.Me.MyCourses.Num;
NumMyCrs++)
if (Gbl.Usrs.Me.MyCourses.Crss[NumMyCrs].CrsCod == CrsCod)
return Gbl.Usrs.Me.MyCourses.Crss[NumMyCrs].Role;
return Rol_ROLE_GUEST;
}
return Rol_ROLE_UNKNOWN; // No course
}
/*****************************************************************************/
/********************** Get role of a user in a course ***********************/
/*****************************************************************************/
Rol_Role_t Rol_GetRoleInCrs (long CrsCod,long UsrCod)
{
char Query[256];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
Rol_Role_t Role;
if (CrsCod > 0)
{
/***** Get rol of a user in a course from database.
The result of the query will have one row or none *****/
sprintf (Query,"SELECT Role FROM crs_usr"
" WHERE CrsCod='%ld' AND UsrCod='%ld'",
CrsCod,UsrCod);
if (DB_QuerySELECT (Query,&mysql_res,"can not get the role of a user in a course") == 1) // User belongs to the course
{
row = mysql_fetch_row (mysql_res);
Role = Rol_ConvertUnsignedStrToRole (row[0]);
}
else // User does not belong to the course
Role = Rol_ROLE_UNKNOWN;
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
}
else // No course
Role = Rol_ROLE_UNKNOWN;
return Role;
}
/*****************************************************************************/
/**************** Get roles of a user in all his/her courses *****************/
/*****************************************************************************/
unsigned Rol_GetRolesInAllCrss (long UsrCod)
{
char Query[512];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned NumRole;
unsigned NumRoles;
Rol_Role_t Role;
unsigned Roles = 0;
/***** Get distinct roles in all the courses of the user from database *****/
sprintf (Query,"SELECT DISTINCT(Role) FROM crs_usr"
" WHERE UsrCod='%ld'",
UsrCod);
NumRoles = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get the roles of a user in all his/her courses");
for (NumRole = 0;
NumRole < NumRoles;
NumRole++)
{
row = mysql_fetch_row (mysql_res);
if ((Role = Rol_ConvertUnsignedStrToRole (row[0])) != Rol_ROLE_UNKNOWN)
Roles |= (1 << Role);
}
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
return Roles;
}
/*****************************************************************************/
/********************** Get role from unsigned string ************************/
/*****************************************************************************/
Rol_Role_t Rol_ConvertUnsignedStrToRole (const char *UnsignedStr)
{
unsigned UnsignedNum;
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
return (UnsignedNum >= Rol_NUM_ROLES) ? Rol_ROLE_UNKNOWN :
(Rol_Role_t) UnsignedNum;
return Rol_ROLE_UNKNOWN;
}
/*****************************************************************************/
/****** Get roles (several bits can be activated) from unsigned string *******/
/*****************************************************************************/
unsigned Rol_ConvertUnsignedStrToRoles (const char *UnsignedStr)
{
unsigned UnsignedNum;
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
return UnsignedNum;
return 0;
}
/*****************************************************************************/
/*********************** Put a form to change my role ************************/
/*****************************************************************************/
void Rol_PutFormToChangeMyRole (bool FormInHead)
{
extern const char *Txt_ROLES_SINGULAR_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
static const unsigned SelectorWidth[Lay_NUM_LAYOUTS] =
{
90, // Lay_LAYOUT_DESKTOP
90, // Lay_LAYOUT_MOBILE
};
Rol_Role_t Role;
Act_FormStart (ActChgMyRol);
fprintf (Gbl.F.Out,"<select name=\"UsrTyp\"");
if (FormInHead)
fprintf (Gbl.F.Out," style=\"width:%upx;\"",SelectorWidth[Gbl.Prefs.Layout]);
fprintf (Gbl.F.Out," onchange=\"javascript:document.getElementById('%s').submit();\">",
Gbl.FormId);
for (Role = Rol_ROLE_GUEST;
Role < Rol_NUM_ROLES;
Role++)
if (Gbl.Usrs.Me.AvailableRoles & (1 << Role))
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Role);
if (Role == Gbl.Usrs.Me.LoggedRole)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",
Txt_ROLES_SINGULAR_Abc[Role][Gbl.Usrs.Me.UsrDat.Sex]);
}
fprintf (Gbl.F.Out,"</select>"
"</form>");
}
/*****************************************************************************/
/****************************** Change my role *******************************/
/*****************************************************************************/
void Rol_ChangeMyRole (void)
{
char UnsignedStr[10+1];
unsigned UnsignedNum;
/***** Get parameter with the new logged role ******/
Par_GetParToText ("UsrTyp",UnsignedStr,10);
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
{
/* Check if new role is a correct type *****/
if (UnsignedNum >= Rol_NUM_ROLES)
return;
/* Check if new role is allowed for me */
if (!(Gbl.Usrs.Me.AvailableRoles & (1 << UnsignedNum)))
return;
/* New role is correct and is allowed for me, so change my logged user type */
Gbl.Usrs.Me.LoggedRole = (Rol_Role_t) UnsignedNum;
/* Update logged role in session */
Ses_UpdateSessionDataInDB ();
}
}
/*****************************************************************************/
/********************* Write selector of users' roles ************************/
/*****************************************************************************/
void Rol_WriteSelectorRoles (unsigned Roles)
{
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
Rol_Role_t Role;
for (Role = Rol_ROLE_STUDENT;
Role <= Rol_ROLE_TEACHER;
Role++)
{
fprintf (Gbl.F.Out,"<input type=\"checkbox\" name=\"Roles\" value=\"%u\"",
(unsigned) Role);
if ((Roles & (1 << Role)))
fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," />%s<br />",
Txt_ROLES_PLURAL_abc[Role][Usr_SEX_UNKNOWN]);
}
}
/*****************************************************************************/
/************************* Get selected users' roles *************************/
/*****************************************************************************/
void Rol_GetSelectedRoles (unsigned *Roles)
{
char StrRoles[(10+1)*2];
const char *Ptr;
char UnsignedStr[10+1];
Rol_Role_t Role;
Par_GetParMultiToText ("Roles",StrRoles,(10+1)*2);
*Roles = 0;
for (Ptr = StrRoles;
*Ptr;)
{
Par_GetNextStrUntilSeparParamMult (&Ptr,UnsignedStr,10);
if (sscanf (UnsignedStr,"%u",&Role) != 1)
Lay_ShowErrorAndExit ("can not get user's role");
*Roles |= (1 << Role);
}
}
/*****************************************************************************/
/*** Select types of user to register/remove users to/from current course ****/
/*****************************************************************************/
void Rol_PutAllRolesRegRemUsrsCrs (void)
{
extern const char *The_ClassFormul[The_NUM_THEMES];
/***** Students or teachers *****/
fprintf (Gbl.F.Out,"<div style=\"display:inline-block; margin:0 auto;\">"
"<ul style=\"list-style-type:none; text-align:left;\" class=\"%s\">",
The_ClassFormul[Gbl.Prefs.Theme]);
Rol_PutOneRoleRegRemUsrsCrs (Rol_ROLE_STUDENT,true);
Rol_PutOneRoleRegRemUsrsCrs (Rol_ROLE_TEACHER,false);
fprintf (Gbl.F.Out,"</ul>"
"</div>");
}
/*****************************************************************************/
/*** Select types of user to register/remove users to/from current course ****/
/*****************************************************************************/
static void Rol_PutOneRoleRegRemUsrsCrs (Rol_Role_t Role,bool Checked)
{
extern const char *Txt_ROLES_SINGULAR_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
fprintf (Gbl.F.Out,"<li>"
"<input type=\"radio\" name=\"RegRemRole\" value=\"%u\"",
(unsigned) Role);
if (Checked)
fprintf (Gbl.F.Out," checked=\"checked\"");
switch (Gbl.Usrs.Me.LoggedRole) // Can I select type of user?
{
case Rol_ROLE_DEG_ADMIN:
case Rol_ROLE_SUPERUSER: // Yes, I can
break;
default: // No, I can not
fprintf (Gbl.F.Out," disabled=\"disabled\"");
break;
}
fprintf (Gbl.F.Out," />%s</li>",
Txt_ROLES_SINGULAR_Abc[Role][Usr_SEX_UNKNOWN]);
}

View File

@ -63,4 +63,24 @@ typedef enum
/****************************** Public prototypes ****************************/
/*****************************************************************************/
unsigned Rol_GetNumAvailableRoles (void);
Rol_Role_t Rol_GetMaxRole (unsigned Roles);
Rol_Role_t Rol_GetMyMaxRoleInIns (long InsCod);
Rol_Role_t Rol_GetMyMaxRoleInCtr (long CtrCod);
Rol_Role_t Rol_GetMyMaxRoleInDeg (long DegCod);
Rol_Role_t Rol_GetMyRoleInCrs (long CrsCod);
Rol_Role_t Rol_GetRoleInCrs (long CrsCod,long UsrCod);
unsigned Rol_GetRolesInAllCrss (long UsrCod);
Rol_Role_t Rol_ConvertUnsignedStrToRole (const char *UnsignedStr);
unsigned Rol_ConvertUnsignedStrToRoles (const char *UnsignedStr);
void Rol_PutFormToChangeMyRole (bool FormInHead);
void Rol_ChangeMyRole (void);
void Rol_WriteSelectorRoles (unsigned Roles);
void Rol_GetSelectedRoles (unsigned *Roles);
void Rol_PutAllRolesRegRemUsrsCrs (void);
#endif

View File

@ -1651,7 +1651,7 @@ void Svy_RequestCreatOrEditSvy (void)
"<td align=\"right\" valign=\"top\" class=\"TIT_TBL\">%s:</td>"
"<td align=\"left\" valign=\"middle\" class=\"DAT\">",
Txt_Users);
Usr_WriteSelectorRoles (Svy.Roles);
Rol_WriteSelectorRoles (Svy.Roles);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
@ -1879,7 +1879,7 @@ void Svy_RecFormSurvey (void)
NewSvy.DateTimes[Svy_END_TIME].Time.Second = 59;
/***** Get users who can answer this survey *****/
Usr_GetSelectedRoles (&(NewSvy.Roles));
Rol_GetSelectedRoles (&(NewSvy.Roles));
/***** Check if title is correct *****/
if (NewSvy.Title[0]) // If there's a survey title

View File

@ -114,8 +114,6 @@ static Usr_Sex_t Usr_GetSexFromStr (const char *Str);
static bool Usr_CheckIfMyBirthdayHasNotBeenCongratulated (void);
static void Usr_InsertMyBirthday (void);
static unsigned Usr_GetNumAvailableRoles (void);
static void Usr_PutFormToChangeMyRole (bool FormInHead);
static void Usr_GetParamOtherUsrIDNickOrEMail (void);
@ -124,7 +122,6 @@ static bool Usr_ChkUsrAndGetUsrDataFromExternalLogin (void);
static bool Usr_ChkUsrAndGetUsrDataFromSession (void);
static void Usr_SetUsrRoleAndPrefs (void);
static Rol_Role_t Usr_GetMaxRole (unsigned Roles);
static void Usr_InsertMyLastData (void);
@ -176,51 +173,6 @@ static unsigned Usr_GetNumUsrsBelongingToAnyCrs (Rol_Role_t Role);
static float Usr_GetNumCrssPerUsr (Rol_Role_t Role);
static float Usr_GetNumUsrsPerCrs (Rol_Role_t Role);
/*****************************************************************************/
/********************* Write selector of users' roles ************************/
/*****************************************************************************/
void Usr_WriteSelectorRoles (unsigned Roles)
{
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
Rol_Role_t Role;
for (Role = Rol_ROLE_STUDENT;
Role <= Rol_ROLE_TEACHER;
Role++)
{
fprintf (Gbl.F.Out,"<input type=\"checkbox\" name=\"Roles\" value=\"%u\"",
(unsigned) Role);
if ((Roles & (1 << Role)))
fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," />%s<br />",
Txt_ROLES_PLURAL_abc[Role][Usr_SEX_UNKNOWN]);
}
}
/*****************************************************************************/
/************************* Get selected users' roles *************************/
/*****************************************************************************/
void Usr_GetSelectedRoles (unsigned *Roles)
{
char StrRoles[(10+1)*2];
const char *Ptr;
char UnsignedStr[10+1];
Rol_Role_t Role;
Par_GetParMultiToText ("Roles",StrRoles,(10+1)*2);
*Roles = 0;
for (Ptr = StrRoles;
*Ptr;)
{
Par_GetNextStrUntilSeparParamMult (&Ptr,UnsignedStr,10);
if (sscanf (UnsignedStr,"%u",&Role) != 1)
Lay_ShowErrorAndExit ("can not get user's role");
*Roles |= (1 << Role);
}
}
/*****************************************************************************/
/**** Show alert about number of clicks remaining before sending my photo ****/
/*****************************************************************************/
@ -415,33 +367,6 @@ void Usr_GetUsrCodFromEncryptedUsrCod (struct UsrData *UsrDat)
UsrDat->UsrCod = -1L;
}
/*****************************************************************************/
/********************** Get role from unsigned string ************************/
/*****************************************************************************/
Rol_Role_t Usr_ConvertUnsignedStrToRole (const char *UnsignedStr)
{
unsigned UnsignedNum;
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
return (UnsignedNum >= Rol_NUM_ROLES) ? Rol_ROLE_UNKNOWN :
(Rol_Role_t) UnsignedNum;
return Rol_ROLE_UNKNOWN;
}
/*****************************************************************************/
/****** Get roles (several bits can be activated) from unsigned string *******/
/*****************************************************************************/
unsigned Usr_ConvertUnsignedStrToRoles (const char *UnsignedStr)
{
unsigned UnsignedNum;
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
return UnsignedNum;
return 0;
}
/*****************************************************************************/
/************ Get user's data from database giving a user's code *************/
/*****************************************************************************/
@ -489,8 +414,8 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
UsrDat->Password[sizeof (UsrDat->Password)-1] = '\0';
/* Get roles */
UsrDat->RoleInCurrentCrsDB = Usr_GetRoleInCrs (Gbl.CurrentCrs.Crs.CrsCod,UsrDat->UsrCod);
UsrDat->Roles = Usr_GetRolesInAllCrss (UsrDat->UsrCod);
UsrDat->RoleInCurrentCrsDB = Rol_GetRoleInCrs (Gbl.CurrentCrs.Crs.CrsCod,UsrDat->UsrCod);
UsrDat->Roles = Rol_GetRolesInAllCrss (UsrDat->UsrCod);
if (UsrDat->RoleInCurrentCrsDB == Rol_ROLE_UNKNOWN)
UsrDat->RoleInCurrentCrsDB = (UsrDat->Roles < (1 << Rol_ROLE_STUDENT)) ?
Rol_ROLE_GUEST : // User does not belong to any course
@ -713,171 +638,6 @@ static Usr_Sex_t Usr_GetSexFromStr (const char *Str)
return Usr_SEX_UNKNOWN;
}
/*****************************************************************************/
/******************* Get my maximum role in a institution ********************/
/*****************************************************************************/
Rol_Role_t Usr_GetMyMaxRoleInIns (long InsCod)
{
unsigned NumMyIns;
if (InsCod > 0)
{
/***** Fill the list with the institutions I belong to (if not already filled) *****/
Usr_GetMyInstitutions ();
/***** Check if the institution passed as parameter is any of my institutions *****/
for (NumMyIns = 0;
NumMyIns < Gbl.Usrs.Me.MyInstitutions.Num;
NumMyIns++)
if (Gbl.Usrs.Me.MyInstitutions.Inss[NumMyIns].InsCod == InsCod)
return Gbl.Usrs.Me.MyInstitutions.Inss[NumMyIns].MaxRole;
return Rol_ROLE_GUEST;
}
return Rol_ROLE_UNKNOWN; // No degree
}
/*****************************************************************************/
/********************** Get my maximum role in a centre **********************/
/*****************************************************************************/
Rol_Role_t Usr_GetMyMaxRoleInCtr (long CtrCod)
{
unsigned NumMyCtr;
if (CtrCod > 0)
{
/***** Fill the list with the centres I belong to (if not already filled) *****/
Usr_GetMyCentres ();
/***** Check if the centre passed as parameter is any of my centres *****/
for (NumMyCtr = 0;
NumMyCtr < Gbl.Usrs.Me.MyCentres.Num;
NumMyCtr++)
if (Gbl.Usrs.Me.MyCentres.Ctrs[NumMyCtr].CtrCod == CtrCod)
return Gbl.Usrs.Me.MyCentres.Ctrs[NumMyCtr].MaxRole;
return Rol_ROLE_GUEST;
}
return Rol_ROLE_UNKNOWN; // No centre
}
/*****************************************************************************/
/********************** Get my maximum role in a degree **********************/
/*****************************************************************************/
Rol_Role_t Usr_GetMyMaxRoleInDeg (long DegCod)
{
unsigned NumMyDeg;
if (DegCod > 0)
{
/***** Fill the list with the degrees I belong to (if not already filled) *****/
Usr_GetMyDegrees ();
/***** Check if the degree passed as parameter is any of my degrees *****/
for (NumMyDeg = 0;
NumMyDeg < Gbl.Usrs.Me.MyDegrees.Num;
NumMyDeg++)
if (Gbl.Usrs.Me.MyDegrees.Degs[NumMyDeg].DegCod == DegCod)
return Gbl.Usrs.Me.MyDegrees.Degs[NumMyDeg].MaxRole;
return Rol_ROLE_GUEST;
}
return Rol_ROLE_UNKNOWN; // No degree
}
/*****************************************************************************/
/*************************** Get my role in a course *************************/
/*****************************************************************************/
Rol_Role_t Usr_GetMyRoleInCrs (long CrsCod)
{
unsigned NumMyCrs;
if (CrsCod > 0)
{
/***** Fill the list with the courses I belong to (if not already filled) *****/
Usr_GetMyCourses ();
/***** Check if the course passed as parameter is any of my courses *****/
for (NumMyCrs = 0;
NumMyCrs < Gbl.Usrs.Me.MyCourses.Num;
NumMyCrs++)
if (Gbl.Usrs.Me.MyCourses.Crss[NumMyCrs].CrsCod == CrsCod)
return Gbl.Usrs.Me.MyCourses.Crss[NumMyCrs].Role;
return Rol_ROLE_GUEST;
}
return Rol_ROLE_UNKNOWN; // No course
}
/*****************************************************************************/
/********************** Get role of a user in a course ***********************/
/*****************************************************************************/
Rol_Role_t Usr_GetRoleInCrs (long CrsCod,long UsrCod)
{
char Query[256];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
Rol_Role_t Role;
if (CrsCod > 0)
{
/***** Get rol of a user in a course from database.
The result of the query will have one row or none *****/
sprintf (Query,"SELECT Role FROM crs_usr"
" WHERE CrsCod='%ld' AND UsrCod='%ld'",
CrsCod,UsrCod);
if (DB_QuerySELECT (Query,&mysql_res,"can not get the role of a user in a course") == 1) // User belongs to the course
{
row = mysql_fetch_row (mysql_res);
Role = Usr_ConvertUnsignedStrToRole (row[0]);
}
else // User does not belong to the course
Role = Rol_ROLE_UNKNOWN;
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
}
else // No course
Role = Rol_ROLE_UNKNOWN;
return Role;
}
/*****************************************************************************/
/**************** Get roles of a user in all his/her courses *****************/
/*****************************************************************************/
unsigned Usr_GetRolesInAllCrss (long UsrCod)
{
char Query[512];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned NumRole;
unsigned NumRoles;
Rol_Role_t Role;
unsigned Roles = 0;
/***** Get distinct roles in all the courses of the user from database *****/
sprintf (Query,"SELECT DISTINCT(Role) FROM crs_usr"
" WHERE UsrCod='%ld'",
UsrCod);
NumRoles = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get the roles of a user in all his/her courses");
for (NumRole = 0;
NumRole < NumRoles;
NumRole++)
{
row = mysql_fetch_row (mysql_res);
if ((Role = Usr_ConvertUnsignedStrToRole (row[0])) != Rol_ROLE_UNKNOWN)
Roles |= (1 << Role);
}
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
return Roles;
}
/*****************************************************************************/
/********** Build full name using FirstName, Surname1 and Surname2 ***********/
/*****************************************************************************/
@ -1018,7 +778,7 @@ void Usr_GetMyInstitutions (void)
Lay_ShowErrorAndExit ("Maximum number of institutions of a user exceeded.");
Gbl.Usrs.Me.MyInstitutions.Inss[Gbl.Usrs.Me.MyInstitutions.Num].InsCod = InsCod;
Gbl.Usrs.Me.MyInstitutions.Inss[Gbl.Usrs.Me.MyInstitutions.Num].MaxRole = Usr_ConvertUnsignedStrToRole (row[1]);
Gbl.Usrs.Me.MyInstitutions.Inss[Gbl.Usrs.Me.MyInstitutions.Num].MaxRole = Rol_ConvertUnsignedStrToRole (row[1]);
Gbl.Usrs.Me.MyInstitutions.Num++;
}
@ -1065,7 +825,7 @@ void Usr_GetMyCentres (void)
Lay_ShowErrorAndExit ("Maximum number of centres of a user exceeded.");
Gbl.Usrs.Me.MyCentres.Ctrs[Gbl.Usrs.Me.MyCentres.Num].CtrCod = CtrCod;
Gbl.Usrs.Me.MyCentres.Ctrs[Gbl.Usrs.Me.MyCentres.Num].MaxRole = Usr_ConvertUnsignedStrToRole (row[1]);
Gbl.Usrs.Me.MyCentres.Ctrs[Gbl.Usrs.Me.MyCentres.Num].MaxRole = Rol_ConvertUnsignedStrToRole (row[1]);
Gbl.Usrs.Me.MyCentres.Num++;
}
@ -1112,7 +872,7 @@ void Usr_GetMyDegrees (void)
Lay_ShowErrorAndExit ("Maximum number of degrees of a user exceeded.");
Gbl.Usrs.Me.MyDegrees.Degs[Gbl.Usrs.Me.MyDegrees.Num].DegCod = DegCod;
Gbl.Usrs.Me.MyDegrees.Degs[Gbl.Usrs.Me.MyDegrees.Num].MaxRole = Usr_ConvertUnsignedStrToRole (row[1]);
Gbl.Usrs.Me.MyDegrees.Degs[Gbl.Usrs.Me.MyDegrees.Num].MaxRole = Rol_ConvertUnsignedStrToRole (row[1]);
Gbl.Usrs.Me.MyDegrees.Num++;
}
@ -1159,7 +919,7 @@ void Usr_GetMyCourses (void)
Lay_ShowErrorAndExit ("Maximum number of courses of a user exceeded.");
Gbl.Usrs.Me.MyCourses.Crss[Gbl.Usrs.Me.MyCourses.Num].CrsCod = CrsCod;
Gbl.Usrs.Me.MyCourses.Crss[Gbl.Usrs.Me.MyCourses.Num].Role = Usr_ConvertUnsignedStrToRole (row[1]);
Gbl.Usrs.Me.MyCourses.Crss[Gbl.Usrs.Me.MyCourses.Num].Role = Rol_ConvertUnsignedStrToRole (row[1]);
Gbl.Usrs.Me.MyCourses.Crss[Gbl.Usrs.Me.MyCourses.Num].DegCod = Str_ConvertStrCodToLongCod (row[2]);
Gbl.Usrs.Me.MyCourses.Num++;
}
@ -1678,13 +1438,13 @@ void Usr_WriteLoggedUsrHead (void)
char UsrFullName[(Usr_MAX_BYTES_NAME+1)*3];
/***** User's type *****/
if (Usr_GetNumAvailableRoles () == 1)
if (Rol_GetNumAvailableRoles () == 1)
fprintf (Gbl.F.Out,"<span class=\"%s\">%s:&nbsp;</span>",
The_ClassUsr[Gbl.Prefs.Theme],
Txt_ROLES_SINGULAR_Abc[Gbl.Usrs.Me.LoggedRole][Gbl.Usrs.Me.UsrDat.Sex]);
else
{
Usr_PutFormToChangeMyRole (true);
Rol_PutFormToChangeMyRole (true);
fprintf (Gbl.F.Out,"<span class=\"%s\">&nbsp;</span>",
The_ClassUsr[Gbl.Prefs.Theme]);
}
@ -1715,59 +1475,6 @@ void Usr_WriteLoggedUsrHead (void)
fprintf (Gbl.F.Out,"</span>");
}
/*****************************************************************************/
/****************** Get number of available roles for me *********************/
/*****************************************************************************/
static unsigned Usr_GetNumAvailableRoles (void)
{
Rol_Role_t Role;
unsigned NumAvailableRoles = 0;
for (Role = Rol_ROLE_GUEST;
Role < Rol_NUM_ROLES;
Role++)
if (Gbl.Usrs.Me.AvailableRoles & (1 << Role))
NumAvailableRoles++;
return NumAvailableRoles;
}
/*****************************************************************************/
/*********************** Put a form to change my role ************************/
/*****************************************************************************/
static void Usr_PutFormToChangeMyRole (bool FormInHead)
{
extern const char *Txt_ROLES_SINGULAR_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
static const unsigned SelectorWidth[Lay_NUM_LAYOUTS] =
{
90, // Lay_LAYOUT_DESKTOP
90, // Lay_LAYOUT_MOBILE
};
Rol_Role_t Role;
Act_FormStart (ActChgMyRol);
fprintf (Gbl.F.Out,"<select name=\"UsrTyp\"");
if (FormInHead)
fprintf (Gbl.F.Out," style=\"width:%upx;\"",SelectorWidth[Gbl.Prefs.Layout]);
fprintf (Gbl.F.Out," onchange=\"javascript:document.getElementById('%s').submit();\">",
Gbl.FormId);
for (Role = Rol_ROLE_GUEST;
Role < Rol_NUM_ROLES;
Role++)
if (Gbl.Usrs.Me.AvailableRoles & (1 << Role))
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Role);
if (Role == Gbl.Usrs.Me.LoggedRole)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",
Txt_ROLES_SINGULAR_Abc[Role][Gbl.Usrs.Me.UsrDat.Sex]);
}
fprintf (Gbl.F.Out,"</select>"
"</form>");
}
/*****************************************************************************/
/*************** Put a form to close current session (log out) ***************/
/*****************************************************************************/
@ -2469,12 +2176,12 @@ static void Usr_SetUsrRoleAndPrefs (void)
Deg_InitCurrentCourse ();
/* Get again my role in this course */
Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB = Usr_GetRoleInCrs (Gbl.CurrentCrs.Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod);
Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB = Rol_GetRoleInCrs (Gbl.CurrentCrs.Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod);
}
}
/***** Set the user's role I am logged *****/
Gbl.Usrs.Me.MaxRole = Usr_GetMaxRole (Gbl.Usrs.Me.UsrDat.Roles);
Gbl.Usrs.Me.MaxRole = Rol_GetMaxRole (Gbl.Usrs.Me.UsrDat.Roles);
Gbl.Usrs.Me.LoggedRole = (Gbl.Usrs.Me.RoleFromSession == Rol_ROLE_UNKNOWN) ? // If no logged role retrieved from session...
Gbl.Usrs.Me.MaxRole : // ...set current logged role to maximum role in database
Gbl.Usrs.Me.RoleFromSession; // Get logged role from session
@ -2541,19 +2248,6 @@ static void Usr_SetUsrRoleAndPrefs (void)
}
}
/*****************************************************************************/
/************ Get maximum role of a user in all his/her courses **************/
/*****************************************************************************/
static Rol_Role_t Usr_GetMaxRole (unsigned Roles)
{
if (Roles & (1 << Rol_ROLE_TEACHER))
return Rol_ROLE_TEACHER;
if (Roles & (1 << Rol_ROLE_STUDENT))
return Rol_ROLE_STUDENT;
return Rol_ROLE_GUEST;
}
/*****************************************************************************/
/******** Write warning when degree type does not allow direct login *********/
/*****************************************************************************/
@ -2588,35 +2282,6 @@ void Usr_WarningWhenDegreeTypeDoesntAllowDirectLogin (void)
}
}
/*****************************************************************************/
/****************************** Change my role *******************************/
/*****************************************************************************/
void Usr_ChangeMyRole (void)
{
char UnsignedStr[10+1];
unsigned UnsignedNum;
/***** Get parameter with the new logged role ******/
Par_GetParToText ("UsrTyp",UnsignedStr,10);
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
{
/* Check if new role is a correct type *****/
if (UnsignedNum >= Rol_NUM_ROLES)
return;
/* Check if new role is allowed for me */
if (!(Gbl.Usrs.Me.AvailableRoles & (1 << UnsignedNum)))
return;
/* New role is correct and is allowed for me, so change my logged user type */
Gbl.Usrs.Me.LoggedRole = (Rol_Role_t) UnsignedNum;
/* Update logged role in session */
Ses_UpdateSessionDataInDB ();
}
}
/*****************************************************************************/
/************** Show forms to change my role and to log out ******************/
/*****************************************************************************/
@ -2645,11 +2310,11 @@ void Usr_ShowFormsRoleAndLogout (void)
Lay_ShowAlert (Lay_INFO,Gbl.Message);
/***** Put a form to change my role *****/
if (Usr_GetNumAvailableRoles () > 1)
if (Rol_GetNumAvailableRoles () > 1)
{
fprintf (Gbl.F.Out,"<div align=\"center\" class=\"%s\">%s: ",
The_ClassFormul[Gbl.Prefs.Theme],Txt_Role);
Usr_PutFormToChangeMyRole (false);
Rol_PutFormToChangeMyRole (false);
fprintf (Gbl.F.Out,"</div>");
}
}

View File

@ -190,9 +190,6 @@ struct ListUsrCods
/****************************** Public prototypes ****************************/
/*****************************************************************************/
void Usr_WriteSelectorRoles (unsigned Roles);
void Usr_GetSelectedRoles (unsigned *Roles);
void Usr_InformAboutNumClicksBeforePhoto (void);
void Usr_UsrDataConstructor (struct UsrData *UsrDat);
@ -203,16 +200,8 @@ void Usr_GetAllUsrDataFromUsrCod (struct UsrData *UsrDat);
void Usr_AllocateListUsrCods (struct ListUsrCods *ListUsrCods);
void Usr_FreeListUsrCods (struct ListUsrCods *ListUsrCods);
void Usr_GetUsrCodFromEncryptedUsrCod (struct UsrData *UsrDat);
Rol_Role_t Usr_ConvertUnsignedStrToRole (const char *UnsignedStr);
unsigned Usr_ConvertUnsignedStrToRoles (const char *UnsignedStr);
void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat);
Rol_Role_t Usr_GetMyMaxRoleInIns (long InsCod);
Rol_Role_t Usr_GetMyMaxRoleInCtr (long CtrCod);
Rol_Role_t Usr_GetMyMaxRoleInDeg (long DegCod);
Rol_Role_t Usr_GetMyRoleInCrs (long CrsCod);
Rol_Role_t Usr_GetRoleInCrs (long CrsCod,long UsrCod);
unsigned Usr_GetRolesInAllCrss (long UsrCod);
void Usr_BuildFullName (struct UsrData *UsrDat);
void Usr_RestrictLengthAndWriteName (struct UsrData *UsrDat,unsigned MaxChars);
@ -254,7 +243,6 @@ bool Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (void);
void Usr_ChkUsrAndGetUsrData (void);
void Usr_WarningWhenDegreeTypeDoesntAllowDirectLogin (void);
void Usr_ChangeMyRole (void);
void Usr_ShowFormsRoleAndLogout (void);
unsigned Usr_UpdateMyClicksWithoutPhoto (void);