2017-10-19 Fred Gleason <fredg@paravelsystems.com>

* Removed 'RDStation::broadcastSecurity()' and
	'RDStation::setBroadcastSecurity()' methods.
This commit is contained in:
Fred Gleason
2017-10-19 13:46:10 -04:00
parent 0bedb70eca
commit aa42224568
13 changed files with 43 additions and 232 deletions

View File

@@ -529,16 +529,13 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
edit_purgedate_box->setChecked(true);
edit_purgedate_edit->setDate(purge_date);
}
if (rdstation_conf->broadcastSecurity() == RDStation::UserSec) {
services_list = rduser->services();
} else { // RDStation::HostSec
sql=QString("select NAME from SERVICES");
q=new RDSqlQuery(sql);
while(q->next()) {
services_list.append( q->value(0).toString() );
}
delete q;
sql=QString("select NAME from SERVICES");
q=new RDSqlQuery(sql);
while(q->next()) {
services_list.append( q->value(0).toString() );
}
delete q;
int n=-1;
int ncounter=0;
QString service=edit_log->service();
@@ -1097,11 +1094,7 @@ void EditLog::saveasData()
RDAddLog *log=NULL;
if(rduser->createLog()) {
if (rdstation_conf->broadcastSecurity() == RDStation::UserSec) {
log=new RDAddLog(&logname,&svcname,NULL,tr("Add Log"),this,rduser);
} else { // RDStation::HostSec
log=new RDAddLog(&logname,&svcname,NULL,tr("Add Log"),this);
}
log=new RDAddLog(&logname,&svcname,NULL,tr("Add Log"),this);
if(log->exec()<0) {
return;
}

View File

@@ -136,28 +136,6 @@ void ListLogs::RefreshList()
list_log_list->clear(); // Note: clear here, in case user has no perms.
sql="select NAME,DESCRIPTION,SERVICE from LOGS where TYPE=0";
if (rdstation_conf->broadcastSecurity() == RDStation::UserSec) {
QStringList services_list;
QString sql_where;
services_list = rduser->services();
if(services_list.size()==0) {
return;
}
sql_where=" and (";
for ( QStringList::Iterator it = services_list.begin();
it != services_list.end(); ++it ) {
sql_where+=QString().sprintf("SERVICE=\"%s\"||",
(const char *)*it);
}
sql_where=sql_where.left(sql_where.length()-2);
sql_where+=")";
sql=sql+sql_where;
} // else no filter for RDStation::HostSec
q=new RDSqlQuery(sql);
while(q->next()) {
l=new QListViewItem(list_log_list);

View File

@@ -421,11 +421,6 @@ void MainWidget::userData()
//
log_add_button->setEnabled(rduser->createLog());
log_delete_button->setEnabled(rduser->deleteLog());
log_track_button->setEnabled(rduser->voicetrackLog());
// Update the list of logs if applicable.
if (rdstation_conf->broadcastSecurity() == RDStation::UserSec) {
RefreshList();
log_track_button->setEnabled(rduser->voicetrackLog());
}
@@ -445,11 +440,7 @@ void MainWidget::addData()
std::vector<QString> newlogs;
RDAddLog *log;
if(rduser->createLog()) {
if (rdstation_conf->broadcastSecurity() == RDStation::UserSec) {
log=new RDAddLog(&logname,&svcname,NULL,tr("Add Log"),this,rduser);
} else { // RDStation::HostSec
log=new RDAddLog(&logname,&svcname,NULL,tr("Add Log"),this);
if(rduser->createLog()) {
log=new RDAddLog(&logname,&svcname,NULL,tr("Add Log"),this);
if(log->exec()!=0) {
delete log;
@@ -841,29 +832,6 @@ void MainWidget::RefreshList()
if(log_recent_check->isChecked()) {
sql+=QString().sprintf("order by ORIGIN_DATETIME desc limit %d",
RDLOGEDIT_LIMIT_QUAN);
}
if (rdstation_conf->broadcastSecurity() == RDStation::UserSec
&& rduser != NULL) {
QStringList services_list;
QString sql_where;
services_list = rduser->services();
if(services_list.size()==0) {
return;
}
sql_where=" and (";
for ( QStringList::Iterator it = services_list.begin();
it != services_list.end(); ++it ) {
sql_where+=QString().sprintf("SERVICE=\"%s\"||",
(const char *)*it);
}
sql_where=sql_where.left(sql_where.length()-2);
sql_where+=")";
sql=sql+sql_where;
} // else no filter for RDStation::HostSec
}
q=new RDSqlQuery(sql);
while(q->next()) {