Jump to content

Ron

uniGUI Subscriber
  • Posts

    374
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Ron

  1. 1. Uncomment that top line, like it says 2. Close your project. 3. Open it again 4. Compile it 5. Find the DLL - it is there somewhere, do a search 6. Copy the DLL to the directory 7. Restart your apache server 8. Try now You can also add DirectoryIndex copsi.dll after "Allow from all"-line, and then you need only specify the directory when loading the app, like in your first "Opening" example. Close and reopen your Delphi project when switching between compiling/running as local exe and compiling a DLL, as you un/comment that top line, to make sure the compiler does it right. If still getting "not found" then check your apache DocumentRoot and put a text file in the directory just to see if you are routed correctly.
  2. Also, to set this up, create a desktop app first, and then add mobile forms afterwards, and not the other way around.
  3. I created a windows service that runs locally, communicating with the receipt printer and the cash register on individual USB-ports, and running a webserver which accepts commands from an indy http client in the unigui app. The app stores the print job as a pdf, saves it to the db, and then just notifies the local service webserver to get the pdf from the db and print it, and report the print and cash drawer open/close status to the db. The local service app is supported by a system tray service control app that also gets intalled, which has options for restarting the service if necessary. Had to set up NAT in the router of course, for the webserver which is inbound, but not for the db connection which is outbound.
  4. The reason for the salt is that somebody could realize that you hashed the pw, and then try to do the same thing to crack it, by hashing pw suggestions using the typical hashing algos, but if you also have a salt stored in the db, which is combined with the hashed pw to re-hash it x times, then things get a notch harder to crack, as there is another element in the mix. If you then store the salt in the cookie, the point of the salt is gone, as it could theoretically be picked up and used in the cracking process. The salt should not be transferred over the net openly (like without SSL), for maximum security.
  5. The pdf is probably not ready to be sent, so the sendfile fails. Try and do a loop, checking FileExists/sleep if not, and wait to send until it exists, and see if that was the issue.
  6. Ron

    Using FreeForm

    You call the getText function, which creates the form, and on modalresult then reads the public text property, which triggers the form's private getText function, which reads the edit text and returns control to the app. Interesting way of using a free form, indeed. I tested it and it works, just remember to set the modalresult properties on the buttons...
  7. 49 years, started with Turbo Pascal 29 years ago, 19 years with Delphi. I started with html around 22 years ago, building static websites, but unfortunately PHP and JS caught my interest much later. Delphi is almost too good, so you get stuck in it...
  8. procedure TfTeste.APesquisarExecute (Sender: TObject); begin case MessageDlg ('mbYesNo', mtConfirmation, mbYesNo) of mrYes: xxxx; mrNo: yyy; end; end;
  9. I bought and used Morfik before switching to Unigui, and sure - it was kind of nice to have that ability, writing it all in pascal. At least it will lower the learning curve for those not familiar with JS. But if you plan on working with the web for some years professionally, wouldn't it be ok to get a basic understanding of the only language that runs in your web OS, which is the browser... I guess the optimum would be the ability to do both, pascal for entry-level and JS for more complex stuff.
  10. Solved - I did an http call in the code...as soon as that was changed to https, it all worked - of course
  11. Hi all, I just installed Comodo EssentialSSL on my apache 2.2 server running ISAPI dll's, and the root page loads with no error, but the Unigui app triggers "mixed content" alert from Firefox. Whats happening here? Is Unigui somehow serving data through port 80, in addition to port 443? I thought when running ISAPI that there was to be no modification of the Unigui project and that only the web server was involved. Or have I missed something here? Kaj
  12. You may not need any complex searching stuff, how 'bout making a list of questions, and a few keywords on each, and do a sql search on the keywords/tags...I assume you will not have a million q's, but let's say 50-100.
  13. Could also work by casting the BLOB as TEXT etc. in the SQL
  14. Something locks up when I try this too, who knows why, can use a timer as a workaround: procedure TMainForm.UniFormShow(Sender: TObject); var sJson, sText : string; AUrl: string; begin sJson := ''; sText :=UniApplication.Parameters.Values['json']; if sText= 'test' then begin uniTimer1.Enabled:=true; end; end; procedure TMainForm.UniTimer1Timer(Sender: TObject); begin UniSession.UrlRedirect('http://www.google.com');//-> no error uniTimer1.Enabled:=false; end;
  15. Ron

    vcl forms

    We should make an open-source vcl-to-unigui parser - there is no other way, really. So we can all share it and use it, for free. It should be part of the Unigui web application toolbox. So, let's just start doing it - who takes the lead?
  16. Sure, you can log anything to text files from the DLL application, like to a /files/log.txt or you can log to the db if you can connect ok.
  17. Ron

    Refresh UniDbGrid

    Did you try to close the query before changing params and opening again? Like this: procedure TMainForm.UniDBGrid1ColumnFilter(Sender: TUniDBGrid; const Column: TUniDBGridColumn; const Value: Variant); begin if UniMainModule.AdsQuery.Active then begin UniMainModule.AdsQuery.Close; UniMainModule.ADsQuery.Params.ParamByName(Column.FieldName).Value := '%'+Value+'%'; UniMainModule.AdsQuery.Open; end end; This is how I have to do it with MySQLDac components, as refresh will not change the sql or params already loaded as the query was opened, but only retrieve new data from the db on the existing query setup.
  18. No problem with the FastReport designer, just double-click the report component and design/edit the report as you normally do in a VCL application. Or are you talking about end-user design capabilities?
  19. You have to modify the params according to need, and remove the IOSSL if not using https.
  20. This is what I use, of course in my language - Norwegian: unit MainModule; interface ... const SNewMsgDlgWarning: PChar = 'Advarsel'; SNewMsgDlgError: PChar = 'Feil'; SNewMsgDlgInformation: PChar = 'Informasjon'; SNewMsgDlgConfirm: PChar = 'Vennligst Bekreft'; SNewMsgDlgYes: PChar = 'Ja'; SNewMsgDlgNo: PChar = 'Nei'; SNewMsgDlgOK: PChar = 'OK'; SNewMsgDlgCancel: PChar = 'Avbryt'; SNewDeleteRecordQuestion: PChar = 'Slett Post?'; SNewDeleteRecord: PChar = 'Slett Post?'; ... initialization RegisterMainModuleClass(TUniMainModule); SetResourceString(@SMsgDlgConfirm, SNewMsgDlgConfirm); SetResourceString(@SMsgDlgWarning, SNewMsgDlgWarning); SetResourceString(@SMsgDlgError, SNewMsgDlgError); SetResourceString(@SMsgDlgInformation, SNewMsgDlgInformation); SetResourceString(@SMsgDlgYes, SNewMsgDlgYes); SetResourceString(@SMsgDlgNo, SNewMsgDlgNo); SetResourceString(@SMsgDlgOK, SNewMsgDlgOK); SetResourceString(@SMsgDlgCancel, SNewMsgDlgCancel); SetResourceString(@SDeleteRecordQuestion, SNewDeleteRecordQuestion); SetResourceString(@SDeleteRecord, SNewDeleteRecord); end.
  21. function PostString(s, url:string):string; var aResponse: TStringStream; aParams:TStringList; mHTTP:TidHTTP; LHandler: TIdSSLIOHandlerSocketOpenSSL; begin mHTTP := TIdHTTP.Create(nil); mHTTP.Request.BasicAuthentication:=false; aParams := TStringList.Create; try LHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); aParams.add('Body='+s); aResponse := TStringStream.Create; try mHTTP.IOHandler:=LHandler; mHTTP.Post(url, aParams, aResponse); finally Result:=aResponse.DataString; LHandler.Free; end; finally aParams.Free; aResponse.Free; mHTTP.Free; end; end;
  22. Hi David, In your code, you are loading an html file: procedure TMainForm.UniFormShow(Sender: TObject); begin HTMLFrame.HTML.LoadFromFile('index.html'); end; And in this html file you have a redirect: <script language="javascript"> window.location.href = "pages/index.html" </script> So in effect you are kicked out of Unigui and the scope of the ajaxRequest function. If you change your onShow event to: procedure TMainForm.UniFormShow(Sender: TObject); begin HTMLFrame.HTML.LoadFromFile('pages/index.html'); end; - you will stay in Unigui and catch the ajaxRequest. Rather load the correct html file into the HTMLFrame directly and adjust the paths to the other css and js files. Kaj
  23. Maybe you can let the user drag files to a listbox, and when ready to download you can then zip them all and send that single file, or trigger download of all files in a row.
  24. Intraweb is obviously doing some state saving in the background then, to a session state table, linking that post to a cookie. But if you do auto-saving of form data, silently, 5 secs after no data change, and link this to the user, and then to a cookie, you will get the same functionality. If your fields are db-aware with a live query, it is just a timer that runs Post, and the cookie can ID both the user and the form last used, taking him back. You can also use a URL param to preserve a session during a refresh, since the URL is read at servermodule.create, but to get that unique URL param you may have to do some trick, like either having two apps, or getting the isapi server to produce a random URL param that can function as a session ID. But a session state component seems like a good idea. To get around the need for informing about cookies, maybe a URL param would solve the issue. Goodbye to clean uRL's then...
  25. There is no built-in event providing info on transfer, as far as I know. Normally the progress is shown on the user side. I suppose you could use a separate indy http server to serve the file and get transfer info that way. Or you may just show a form to the user, counting down to some approximate download time, to show some movement
×
×
  • Create New...