connect_action=newKAction(i18n("Connect to Server"),"connect_creating",KShortcut(),TQT_TQOBJECT(this),TQT_SLOT(connectToServer()),ac,"connect_server");
disconnect_action=newKAction(i18n("Disconnect from Server"),"connect_no",KShortcut(),TQT_TQOBJECT(this),TQT_SLOT(disconnectFromServer()),ac,"disconnect_server");
KMessageBox::error(this,i18n("TDE could not find the %1 Part, or the Remote Laboratory Communications Analyzer Part could not be started. Did you make install?").arg(m_libraryName));
KMessageBox::error(this,i18n("TDE could not find the %1 part, or it could not be started. Did you 'make install'?").arg(m_libraryName));
KMessageBox::error(0,i18n("<qt>Unable to establish Kerberos protocol with remote server<p>Please verify that you currently hold a valid Kerberos ticket</qt>"),i18n("Connection Failed"));
printf("[DEBUG] Connection from %s closed\n\r",m_remoteHost.ascii());
// Update database
m_databaseActivityCursor->select(TQString("station='%1' AND username='%2' AND realmname='%3'").arg(m_stationID).arg(m_authenticatedUserName).arg(m_authenticatedRealmName));
if(m_databaseActivityCursor->next()){
m_databaseActivityCursor->primeDelete();
m_databaseActivityCursor->del(true);
if(m_bound){
// Update database
m_databaseActivityCursor->select(TQString("station='%1' AND username='%2' AND realmname='%3'").arg(m_stationID).arg(m_authenticatedUserName).arg(m_authenticatedRealmName));
if(m_databaseActivityCursor->next()){
m_databaseActivityCursor->primeDelete();
m_databaseActivityCursor->del(true);
}
}
if(m_criticalSection>0){
@ -115,8 +121,6 @@ int AuthSocket::initiateKerberosHandshake() {
}
intAuthSocket::enterCommandLoop(){
boolbound=false;
m_criticalSection++;
try{
TQStringcommand;
@ -196,7 +200,7 @@ int AuthSocket::enterCommandLoop() {
@ -294,7 +345,7 @@ int AuthSocket::connectToDatabase() {
if(!m_database->open()){
printf("[ERROR] Failed to connect to control database on server '%s' [%s]\n\r",m_database->hostName().ascii(),m_database->lastError().text().ascii());fflush(stdout);
deletem_database;
TQSqlDatabase::removeDatabase(m_database);
m_database=NULL;
return-1;
}
@ -302,7 +353,7 @@ int AuthSocket::connectToDatabase() {
if(!m_database->tables().contains("stations")){
m_database->close();
printf("[ERROR] Control database '%s' on '%s' does not contain the required 'stations' table\n\r",m_database->databaseName().ascii(),m_database->hostName().ascii());fflush(stdout);
deletem_database;
TQSqlDatabase::removeDatabase(m_database);
m_database=NULL;
return-1;
}
@ -310,7 +361,7 @@ int AuthSocket::connectToDatabase() {
if(!m_database->tables().contains("services")){
m_database->close();
printf("[ERROR] Control database '%s' on '%s' does not contain the required 'services' table\n\r",m_database->databaseName().ascii(),m_database->hostName().ascii());fflush(stdout);
deletem_database;
TQSqlDatabase::removeDatabase(m_database);
m_database=NULL;
return-1;
}
@ -318,7 +369,7 @@ int AuthSocket::connectToDatabase() {
printf("[ERROR] Control database '%s' on '%s' does not contain the required 'servicetypes' table\n\r",m_database->databaseName().ascii(),m_database->hostName().ascii());fflush(stdout);
deletem_database;
TQSqlDatabase::removeDatabase(m_database);
m_database=NULL;
return-1;
}
@ -326,7 +377,7 @@ int AuthSocket::connectToDatabase() {
printf("[ERROR] Control database '%s' on '%s' does not contain the required 'permissions' table\n\r",m_database->databaseName().ascii(),m_database->hostName().ascii());fflush(stdout);
deletem_database;
TQSqlDatabase::removeDatabase(m_database);
m_database=NULL;
return-1;
}
@ -334,51 +385,21 @@ int AuthSocket::connectToDatabase() {
if(!m_database->tables().contains("activity")){
m_database->close();
printf("[ERROR] Control database '%s' on '%s' does not contain the required 'activity' table\n\r",m_database->databaseName().ascii(),m_database->hostName().ascii());fflush(stdout);
printf("[DEBUG] Connection from %s closed due to authentication failure (attempted connection as user %s@%s)\n\r",s->m_remoteHost.ascii(),masterUser.ascii(),masterRealm.ascii());
s->close();
deletes;
s=NULL;
ABORT_SOCKET(s)
return;
}
if(s->setupSerial()!=0){
printf("[DEBUG] Connection from %s closed due to serial port initialization failure\n\r",s->m_remoteHost.ascii());