Example #1
0
void
CCLCFox::unlockWithPass(FXString tktstr)
{
  /*  char val[sizeof(id) + CCLC_MD5_DIGEST_LENGTH * sizeof(FXuchar)];
  FXuchar digest[CCLC_MD5_DIGEST_LENGTH];
  CCLC_MD5((FXuchar*)(password.text()),password.length(),digest);
  ((FXuint*)val)[0] = CCLC_htonl(id);*/
  //  memcpy(((FXuint*)val)+1,digest,CCLC_MD5_DIGEST_LENGTH); 

  if (tktstr.length() > MAX_INP_SIZE)
    tktstr.trunc(MAX_INP_SIZE);
  CCLC_send_cmd(CC_TICKETLOGIN, tktstr.text(),tktstr.length());
}
Example #2
0
void CmdIO::appendLine(FXString&s, FXSelector selid)
{
  if (target&&message) {
    FXint nlines=s.contains('\n');
    FXString trailer=s.section('\n', nlines);
    s.trunc(s.length()-trailer.length());
    if (multiline_mode) {
      target->handle(this, FXSEL(selid,message), (void*)(&s));
    } else {
      for (FXint i=0; i<nlines; i++) {
        FXString sect=s.section('\n',i);
        target->handle(this, FXSEL(selid,message), (void*)(&sect));
      }
    }
    s=trailer;
  }
}
Example #3
0
void
CCLCFox::unlockWithPass(FXString login,FXString password)
{
  if (login.length() > MAX_INP_SIZE)
    login.trunc(MAX_INP_SIZE);
  const char *login_name = login.text();
  char val[strlen(login_name) * sizeof(char) + 1
	   + CCLC_MD5_DIGEST_LENGTH * sizeof(FXuchar)];
  FXuchar digest[CCLC_MD5_DIGEST_LENGTH];

  CCLC_MD5((FXuchar*)(password.text()),password.length(),digest);
  memcpy(val,login_name,strlen(login_name) + 1);
  memcpy(val + strlen(login_name) + 1,digest,CCLC_MD5_DIGEST_LENGTH);   
  CCLC_send_cmd(CC_MEMBERLOGINWITHNAME,val,sizeof(val) * sizeof(char));
  if (!strncmp(login_name, _("administrator"), 13)){
    if (checkPass((char *)password.text(), password.length())) 
      unlockScreen();      //unlock all the same
  }
}