Jump to content

Fantomas

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by Fantomas

  1. Hi @gebeer

    for me, your solution was just the first step to get it to work.

    I added your line to my .htaccess (by the way, there is another way of notation, both are working for me, I don't know the difference, so use

    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

    OR
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    But I had to do a further step in the rest.inc. Before your Auth-Code-Block, I had to insert:

    //Basic HTTP Authentication
    if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
      list($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])=explode(':',base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'],6)));
    } else if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
      list($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])=explode(':',base64_decode(substr($_SERVER['REDIRECT_HTTP_AUTHORIZATION'],6)));
    }

    //and now your code
    if (isset($_SERVER['PHP_AUTH_USER'])) {

    ...

    }

    My server uses the REDIRECT_HTTP_AUTHORIZATION value.

    Now it works for me. Many thanks to your help.

     

    • Like 1
  2. Hi @gebeer

    sorry, things moving on slowly - too many tasks. How can I submit the request header to you? There is nothing to copy in RestClient. I set the Basic Authentication and the content type (application/json).

    If the .htpass is active, I use these crendentials for authentication and it works. If there is still the if-cause for uname and upass I have to set them in the request body to keep working. But if I remove the .htpass and set the uname and upass keys as Basic Authentication, it doesn't work anymore.

  3. @gebeer thankx for this tutorial. It's a good starting point to explore REST in PW.

    But like @Batyr, I'm not able to make the PUT and POST request in your given way. There are no params "uname" or "upass" in the params array. And there are no $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] set.

    If my page is behind a .htaccess + .htpasswd I can submit these data as basic authentication. But if I try to submit my uname and upass values as basic auth, then it fails. Is there a possibility to submit my own key/value secure data in request header?

  4. Hi all,

    I have a project running pw-2.7.2 on nginx with config from this topic. All works fine.

    But now I want to update to pw-3.0 (or pw-2.8, same problem). After switching the wire-folder and index.php there is an endless redirection.

    Any idea what to do?

     

  5. 18 hours ago, BitPoet said:

    Or, even better since it avoids a roundtrip through the database, would be Pages::cloneReady, which is called after the page is copied in memory and before it is saved to the database. Usage is the same, sans the call to $newpage->save(). I'm using Pages::cloned in my module because I need the ID of the new page which is only available after it has been saved.

    Works perfect. Thanks!

  6. Hi,

    I'm kind of a pw-rookie, it means I only created some (simple) projects with this fantastic cms. But now I need a different and difficult data structure and have a question regarding field dependencies in admin area.

    I have different data trees. Schema:

    one
    -one-1
    --one-1-1
    --one-1-2
    --one-1-3
    -one-2
    --one-2-1
    --one-2-2
    --one-2-3
    
    two
    -two-1
    --two-1-1
    --two-1-2
    -two-2
    --two-2-1
    --two-2-2
    
    data
    -item-1
    -item-2
    -item-3

    "one" and "two" are base data trees, tree "data" is for later frontend output. Now I have in "one-1-1" a page field named "value-type". There I have to choose a value: "two-1" or "two-2".

    Now I edit "data-item-1". There I have to choose "one", "one-1" and "one-1-1". No problems there. In admin field properties I use the custom selector to find selectable pages (parent=page.fieldname).

    Now I want to choose the "two-x-x" value in "data-item-1" depending on the one-1-1 selection. I tried something like parent=page.fieldname.value-type, but it seems to be not possible. What should I do, if I want to get the parent page ("two-1" or "two-2") to make the children selectable for me? Any suggestions?

    Kind regards,

    Thomas

×
×
  • Create New...