Jump to content

Ron

uniGUI Subscriber
  • Posts

    375
  • Joined

  • Last visited

  • Days Won

    31

Posts posted by Ron

  1. Can you go through the cookie? Use a timer to check for changes,

    just curious...but that is the only piece of data accessible to both processes,

    unless you setup a direct websocket connection or go through some

    external data store, like a db or an email or ftp etc.

  2. 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.

  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. 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...

  6. 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...

  7. 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.

  8. 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

  9. 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;

  10. 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? :)

  11. 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.

  12. 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.
    
    • Upvote 1

  13. 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;

     

  14. 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
     

  15. 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...

×
×
  • Create New...