Version 15.163

This commit is contained in:
Antonio Cañas Vargas 2016-03-27 20:33:39 +02:00
parent 2f82414cfb
commit 732d708c62
3 changed files with 46 additions and 7 deletions

View File

@ -98,7 +98,6 @@
// TODO: Put headers Content-type and Content-disposition when redirecting with Location:
// TODO: When a new assignment/attendance/survey is incorrect, the second time the form is shown, it should be filled with partial data, now is always empty
// TODO: Show message indicating that mail could be in SPAM folder?
// TODO: Do not show e-mails of administrators and teachers in lists openly
// TODO: Show nicknames of users in lists?
// TODO: Form to register and remove system admins
// TODO: Fix this bug: when an admin clicks on "Use this email" in the email of another user the email was confirmed, the email becomes unconfirmed
@ -120,24 +119,31 @@
// TODO: Insert "http://" to WWW when WWW does not start with "*://"
// TODO: Change links from external degrees to internal degrees in STATS > Degrees
// TODO: To avoid wrong email addresses, when a user fills his/her email address, check if the domain is in the white list of allowed domains. If not, ask for confirmation.
// TODO: Important!!!! E-mail should not be visible for not logged users
// TODO: Fix bug in marks reported by Francisco Ocaña
// TODO: Icon to the left in list of forums is not correct when scope is system
// TODO: Move info about number of files to bottom of file browsers
// TODO: To avoid wrong email addresses, when a user fills his/her email address, check if the domain is in the white list of allowed domains. If not, ask for confirmation.
// TODO: Filtering email addresses --> an email address can not finish in "."
// TODO: Use libjpeg or similar to check size of uploaded image of a centre
// TODO: Upload an image in social posts, in test questions, in forum posts, in private messages, etc.
// TODO: Important!!!! E-mail should not be visible for not logged users
// TODO: Do not show e-mails of administrators and teachers in lists openly
// TODO: Fix bug in marks reported by Francisco Ocaña
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.162.7 (2016-03-25)"
#define Log_PLATFORM_VERSION "SWAD 15.163 (2016-03-27)"
#define CSS_FILE "swad15.162.1.css"
#define JS_FILE "swad15.131.3.js"
// 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 sql/swad*.sql | tail -1
/*
Version 15.163: Mar 27, 2016 Requests for enrollment older than one month are automatically removed. (196656 lines)
Version 15.162.7: Mar 25, 2016 Changed message after enrollment request. (196625 lines)
Version 15.162.6: Mar 24, 2016 Smaller buttons to see results of surveys.
Fix bug in surveys. (196615 lines)

View File

@ -508,6 +508,8 @@
#define Cfg_TIME_TO_DELETE_TEST_TMP_FILES ((time_t)( 1UL*60UL*60UL)) // Temporary files related to imported test questions after these seconds
#define Cfg_TIME_TO_DELETE_ENROLLMENT_REQUESTS ((time_t)( 30UL*24UL*60UL*60UL)) // Past these seconds, remove expired enrollment requests
#define Cfg_TIME_TO_DELETE_THREAD_CLIPBOARD ((time_t)( 15UL*60UL)) // Threads older than these seconds are removed from clipboard
#define Cfg_TIME_TO_DELETE_OLD_PENDING_PASSWORDS ((time_t)( 24UL*60UL*60UL)) // Past these seconds, remove expired pending passwords

View File

@ -105,6 +105,7 @@ static void Enr_PutLinkToRemAllStdsThisCrs (void);
static void Enr_ShowEnrollmentRequestsGivenRoles (unsigned RolesSelected);
static void Enr_RemoveEnrollmentRequest (long CrsCod,long UsrCod);
static void Enr_RemoveExpiredEnrollmentRequests (void);
static void Enr_ReqRegRemUsr (Rol_Role_t Role);
static bool Enr_CheckIfICanAdminOtherUsrs (void);
@ -2224,6 +2225,9 @@ static void Enr_ShowEnrollmentRequestsGivenRoles (unsigned RolesSelected)
char PhotoURL[PATH_MAX+1];
Rol_Role_t DesiredRole;
/***** Remove expired enrollment requests *****/
Enr_RemoveExpiredEnrollmentRequests ();
/***** Get scope *****/
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
1 << Sco_SCOPE_CTY |
@ -2865,7 +2869,7 @@ static void Enr_ShowEnrollmentRequestsGivenRoles (unsigned RolesSelected)
}
/*****************************************************************************/
/******************** Remove a request for inscription ***********************/
/********************* Remove a request for enrollment ***********************/
/*****************************************************************************/
static void Enr_RemoveEnrollmentRequest (long CrsCod,long UsrCod)
@ -2900,6 +2904,33 @@ static void Enr_RemoveEnrollmentRequest (long CrsCod,long UsrCod)
DB_QueryDELETE (Query,"can not remove a request for enrollment");
}
/*****************************************************************************/
/******************* Remove expired requests for enrollment ******************/
/*****************************************************************************/
static void Enr_RemoveExpiredEnrollmentRequests (void)
{
char Query[512];
/***** Mark possible notifications as removed
Important: do this before removing the request *****/
sprintf (Query,"UPDATE notif,crs_usr_requests"
" SET notif.Status=(notif.Status | %u)"
" WHERE notif.NotifyEvent='%u'"
" AND notif.Cod=crs_usr_requests.ReqCod"
" AND crs_usr_requests.RequestTime<FROM_UNIXTIME(UNIX_TIMESTAMP()-'%lu')",
(unsigned) Ntf_STATUS_BIT_REMOVED,
(unsigned) Ntf_EVENT_ENROLLMENT_REQUEST,
Cfg_TIME_TO_DELETE_ENROLLMENT_REQUESTS);
DB_QueryUPDATE (Query,"can not set notification(s) as removed");
/***** Remove expired requests for enrollment *****/
sprintf (Query,"DELETE FROM crs_usr_requests"
" WHERE RequestTime<FROM_UNIXTIME(UNIX_TIMESTAMP()-'%lu')",
Cfg_TIME_TO_DELETE_ENROLLMENT_REQUESTS);
DB_QueryDELETE (Query,"can not remove expired requests for enrollment");
}
/*****************************************************************************/
/********************** Write a form to admin one user ***********************/
/*****************************************************************************/