Logo Search packages:      
Sourcecode: qtsmbstatus version File versions  Download package

void ClientSocket::CmdAuthRq ( const QString &  texte  )  [private]

Authentication Request

Parameters:
texte arg=1=username, arg2=password
See also:
core_syntax PamThread

Definition at line 310 of file clientsocket.cpp.

References permitDisconnectUser, permitSendMsg, core_syntax::returnArg(), sendToClient(), PamThread::setAuth(), and socketConnectionClose().

{
      debugQt(" ClientSocket :: CmdAuthRq()");
      core_syntax stx(texte);
      QString Username=stx.returnArg(1);
      QString Passwd=stx.returnArg(2);
      if ( (!Username.isEmpty()) && (Username.length () < 50) && (!Passwd.isEmpty()) && (Passwd.length () < 50))
      {
            // if client is authorized to disconnect user
            for ( QStringList::Iterator it = AllowUserDisconnect.begin(); it != AllowUserDisconnect.end(); ++it ) {
                  if (((*it)==Username) || ((*it).lower()=="all")) permitDisconnectUser=true;
            }
            // if client is authorized to send popup message
            for ( QStringList::Iterator it = AllowUserSendMsg.begin(); it != AllowUserSendMsg.end(); ++it ) {
                  if (((*it)==Username) || ((*it).lower()=="all")) permitSendMsg=true;
            }

            // PAM Request
            pamthread->setAuth(Username,Passwd);
            pamthread->start();
            timer->start( 500, FALSE ); //request every 500ms to know pamthread status (finished)
            return;
      }
      sendToClient(error_auth);
      socketConnectionClose();
}


Generated by  Doxygen 1.6.0   Back to index