Example #1
0
void PCloudApp::mount()
{
    if (this->authentication != ""){
        QByteArray auth=this->authentication.toUtf8();
        apisock *conn=getAPISock();
        binresult *res, *result;
        QByteArray err;
        if (!conn)
            return;
        res=send_command(conn, "userinfo",
                         P_LSTR("auth", auth.constData(), auth.size()),
                         P_BOOL("getauth", 1));
        api_close(conn);
        result=find_res(res, "result");
        if (!result){
            free(res);
            return;
        }
        if (result->num!=0){
            free(res);
            return;
        }
        userLogged(res, err, true);
        free(res);
    }
}
void shortLoginDialog::log()
{
    if(t_user->shortpassword() == ui->passwordLineEdit->text()){
        emit userLogged(t_user);
    }else{
        QMessageBox::warning(this, tr("Advertencia"), tr("Password no valido"), QMessageBox::Ok);
    };
    close();
}