mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-29 23:22:35 +02:00
2014-08-17 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in 'web/rdcastmanager/Makefile.am' that caused the incorrect executable to be installed for 'rdcastmanager.cgi'. * Refactored SQL statements in 'lib/rdweb.cpp'.
This commit is contained in:
parent
330075f4ac
commit
173fe17013
@ -14393,3 +14393,7 @@
|
|||||||
* Updated 'get_distro.sh' to detect RHEL 7 correctly.
|
* Updated 'get_distro.sh' to detect RHEL 7 correctly.
|
||||||
* Modified the installation script to work on RHEL 7 in
|
* Modified the installation script to work on RHEL 7 in
|
||||||
'rivendell.spec.in'.
|
'rivendell.spec.in'.
|
||||||
|
2014-08-17 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Fixed a regression in 'web/rdcastmanager/Makefile.am' that caused
|
||||||
|
the incorrect executable to be installed for 'rdcastmanager.cgi'.
|
||||||
|
* Refactored SQL statements in 'lib/rdweb.cpp'.
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <qdatetime.h>
|
#include <qdatetime.h>
|
||||||
#include <qstringlist.h>
|
#include <qstringlist.h>
|
||||||
|
|
||||||
|
#include <rdescape_string.h>
|
||||||
#include <rduser.h>
|
#include <rduser.h>
|
||||||
#include <rddb.h>
|
#include <rddb.h>
|
||||||
#include <rdconf.h>
|
#include <rdconf.h>
|
||||||
@ -686,14 +687,11 @@ long int RDAuthenticateLogin(const QString &username,const QString &passwd,
|
|||||||
timeval=time(&timeval);
|
timeval=time(&timeval);
|
||||||
srandom(timeval);
|
srandom(timeval);
|
||||||
long int session=random();
|
long int session=random();
|
||||||
QString sql=QString().sprintf("insert into WEB_CONNECTIONS set \
|
QString sql=QString("insert into WEB_CONNECTIONS set ")+
|
||||||
SESSION_ID=%ld,\
|
QString().sprintf("SESSION_ID=%ld,",session)+
|
||||||
LOGIN_NAME=\"%s\",\
|
"LOGIN_NAME=\""+RDEscapeString(username)+"\","+
|
||||||
IP_ADDRESS=\"%s\",\
|
"IP_ADDRESS=\""+addr.toString()+"\","+
|
||||||
TIME_STAMP=now()",
|
"TIME_STAMP=now()";
|
||||||
session,
|
|
||||||
(const char *)username,
|
|
||||||
(const char *)addr.toString());
|
|
||||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||||
delete q;
|
delete q;
|
||||||
|
|
||||||
@ -703,25 +701,25 @@ long int RDAuthenticateLogin(const QString &username,const QString &passwd,
|
|||||||
|
|
||||||
QString RDAuthenticateSession(long int session_id,const QHostAddress &addr)
|
QString RDAuthenticateSession(long int session_id,const QHostAddress &addr)
|
||||||
{
|
{
|
||||||
|
QString sql;
|
||||||
|
RDSqlQuery *q;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Expire Stale Sessions
|
// Expire Stale Sessions
|
||||||
//
|
//
|
||||||
QDateTime current_datetime=
|
QDateTime current_datetime=
|
||||||
QDateTime(QDate::currentDate(),QTime::currentTime());
|
QDateTime(QDate::currentDate(),QTime::currentTime());
|
||||||
QString sql=QString().sprintf("delete from WEB_CONNECTIONS \
|
sql=QString("delete from WEB_CONNECTIONS where ")+
|
||||||
where TIME_STAMP<\"%s\"",
|
"TIME_STAMP<\""+current_datetime.addSecs(-RD_WEB_SESSION_TIMEOUT).
|
||||||
(const char *)current_datetime.
|
toString("yyyy-MM-dd hh:mm:ss")+"\"";
|
||||||
addSecs(-RD_WEB_SESSION_TIMEOUT).
|
q=new RDSqlQuery(sql);
|
||||||
toString("yyyy-MM-dd hh:mm:ss"));
|
|
||||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
|
||||||
delete q;
|
delete q;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check for Session
|
// Check for Session
|
||||||
//
|
//
|
||||||
sql=QString().sprintf("select LOGIN_NAME,IP_ADDRESS from WEB_CONNECTIONS \
|
sql=QString("select LOGIN_NAME,IP_ADDRESS from WEB_CONNECTIONS where ")+
|
||||||
where SESSION_ID=%ld",
|
QString().sprintf("SESSION_ID=%ld",session_id);
|
||||||
session_id);
|
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
if(!q->first()) {
|
if(!q->first()) {
|
||||||
delete q;
|
delete q;
|
||||||
@ -737,11 +735,9 @@ QString RDAuthenticateSession(long int session_id,const QHostAddress &addr)
|
|||||||
//
|
//
|
||||||
// Update Session
|
// Update Session
|
||||||
//
|
//
|
||||||
sql=QString().sprintf("update WEB_CONNECTIONS set TIME_STAMP=\"%s\" \
|
sql=QString("update WEB_CONNECTIONS set ")+
|
||||||
where SESSION_ID=%ld",
|
"TIME_STAMP=\""+current_datetime.toString("yyyy-MM-dd hh:mm:dd")+"\" "+
|
||||||
(const char *)current_datetime.
|
QString().sprintf("where SESSION_ID=%ld",session_id);
|
||||||
toString("yyyy-MM-dd hh:mm:dd"),
|
|
||||||
session_id);
|
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
delete q;
|
delete q;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ moc_%.cpp: %.h
|
|||||||
|
|
||||||
install-exec-am:
|
install-exec-am:
|
||||||
mkdir -p $(DESTDIR)/$(libexecdir)
|
mkdir -p $(DESTDIR)/$(libexecdir)
|
||||||
cp rdcastmanager.cgi $(DESTDIR)$(libexecdir)/
|
cp .libs/rdcastmanager.cgi $(DESTDIR)$(libexecdir)/
|
||||||
cat rdcastmanager.js | $(top_srcdir)/helpers/jsmin > $(DESTDIR)$(libexecdir)/rdcastmanager.js
|
cat rdcastmanager.js | $(top_srcdir)/helpers/jsmin > $(DESTDIR)$(libexecdir)/rdcastmanager.js
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user