Jump to content

helmut2509

Members
  • Posts

    110
  • Joined

  • Last visited

Everything posted by helmut2509

  1. if(!session()->isLoggedin) session()->redirect(config()->loginUrl);
  2. In my PW-Application there is currently no session timeout. I want to set the user session to 60 minutes which means that after 60 minutes of inactivity the user will be redirected to the homepage. so I added the following entry to my config.php: $config->sessionExpireSeconds = 120; (120 seconds is just for testing). But after five minutes of inactivity I am still logged in, there is no redirection. Is there anything wrong or did I miss something? In php.ini I have the entry: session.cookie_lifetime = 3600
  3. thanx for the tip. I will try this.
  4. Hello, I am just going to write a class to process data in my pw app. My question: where should I store the class files? should I use a separate directory? Or should I integrate the class in a module? there are certainly different approaches and I am not sure which one to use... thanx for your help.
  5. I use $view->render , where $view is the instance of a template.
  6. thanks. I guess the bug is most probably related to a multiple including of a script.
  7. I checked the entire project folder: there is only ONE declaration of this function!
  8. When calling a page, I get the error (logged in /logs/errors.txt):"Cannot redeclare myfunction..(previously declared in...)" It seems there is a second declaration of this function, but where? I already added the namespace Processwire and switched off template compiling, but to no avail. (PW version 3.0.42) any ideas?
  9. $view is an instance of \ProcessWire\TemplateFile
  10. Hello, I just found out that, when passing a (numeric) zero with "$view->myVar=0" to a template then the corresponding template variable $this->myVar is empty, it has no value. This even occurs when I convert the value to a string: (string) 0 Strings and numeric values other than zero are handled correctly. I think this is a bug which should be fixed?! regards, Helmut
  11. thanks for the tip. In my google search result the above link did not appear ;-((
  12. In my PW app I have now a php script which caters to the upload of files. It does not directly belong to the UI and therefore I did not store it in the templates folder, but in a custom folder. My question is: how do I get access from this script to the Pw API? Can I leave it in the custom folder?
  13. you are right, I have made a stupid error. thanx, guys!
  14. In the function I wrote wire('session')->set('number', '12345'); and outside the function I tried : echo $session->number ...but this variable was empty....
  15. Hello, I want to use the $session variable in functions, inside a template. According to the API this variable is available only in templates. But all values of the $session variable get lost, even when I use 'global $session'. is there any workaround for this problem?
  16. I found it: there was still another dll-entry in the php.ini I had to comment out. Now it works like a charm. But I still do not understand, why and where these components have been referenced and why this error occurred simoultaneously with a json syntax error...and only sporadically. very strange!
  17. This is my code: if(!isset($session->sprachen)){ $action = 'fetchdata/sprachen'; $resultJson = sendData($webserviceUrl,$action,$params); echo "sprachen vom webservice:".$resultJson.'<p>';//correct json string. after the string comes //the error message "Unable to load dynamic library '/usr/lib/php/20151012/php_openssl.dll'" $session->sprachen = json_decode($resultJson,true); echo "json-error-code-sprachen=".json_last_error().'<p>';//here json error 4 occurs (syntax error?!) echo "sprachen22:<pre>";print_r($session->sprachen);echo " count-sprachen=".count($session->sprachen)."</pre>";//$session->sprachen is empty! }
  18. I guess the error is somehow related to the $session-object (of PW). When I logout and then login again, all works fine (in the majority of cases). But then at subsequent calls of one page the error occurs again.
  19. that's already done..... But I wonder from where this extension is called??? My php code is in no way related to soap!
  20. It's not a third party webservice, it' my own ;-)
  21. Hello, In my pw app I am using a webservice to fetch data for a selectbox. Sporadically (not always!) I cannot json_decode the json string I get from the webservice, I get json error code 4 (syntax error). When this occurs I also get the following error message: "Severity: Core Warning Message: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_soap.dll' - /usr/lib/php/20151012/php_soap.dll: cannot open shared object file: No such file or directory". ....though I do NOT use a soap function! the strange thing is that I fetch always the same data and sometimes it works, sometimes it does not work. Any suggestions?
  22. that's the solution. thanx abdus!
  23. Unfortunately this does not work. In both cases I get the error: " Uncaught Error: Call to undefined function ProcessWire\\wire() in...."
  24. Hello, I want to access the $config variable outside the template directory. so I tried $config = wire('config'); ...but got this error: " PHP Fatal error: Uncaught Error: Call to undefined function wire() " What do I have to do?
×
×
  • Create New...