Soap header authentications problems
Hi Guys, I'm using CakePHP and trying to connect to a WSDL SOAP Server created using .NET but until now I'm not able to authenticate by the header. There is any specif way that Cake helps to do that ? Using the SoapUI tool, I'm able to connect and get the results as expected based on this XML input: soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope; xmlns:tem=http://tempuri.org/; soap:Header tem:ValidationHeader !--Optional:-- tem:UserMyUsername/tem:User !--Optional:-- tem:PasswordMyPass/tem:Password /tem:ValidationHeader /soap:Header soap:Body tem:listExamples/ /soap:Body /soap:Envelope Into my controller class, I'm trying public function testSOAP() { $username = ; $password = ; $wsdl=https://myURL?WSDL;; // Setting trace will allow us to view the request that we are making, after we have made it. $objClient = new SoapClient($wsdl, array('trace' = true)); //Body of the Soap Header. $headerbody = array('User' = $username, 'Password' = $password); //Create Soap Header. $header = new SOAPHeader($wsdl, 'ValidationHeader', $headerbody); //set the Headers of Soap Client. $objClient-__setSoapHeaders($header); // Invoke the remote call login(). $Response = $objClient-listExample(); debug($Response); But I'm getting the follow response: System.Web.Services.Protocols.SoapException: Server was unable to process request. --- System.Exception: ServiceX webservice authentication failed. at ServerX2.WebServices.ServerX.listExample() in C:\file.asmx.cs:line 45 --- End of inner exception stack trace --- Using the SoapUI if I change the username and password (to an invalid value) I get the same error message, it means the https protocol is working fine (the client is able to connect to the server) but the SOAP authentication header fails. Any suggestions ? Thanks in advance, -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Soap header authentications problems
Hy Guys, The problem was in the wrong namespace, so authentication was failing. I just changed the namespace to 'http://tempuri.org/' and everything started to works fine. Thanks On Mon, Jun 11, 2012 at 3:24 PM, Felipe Roman roman.fel...@gmail.comwrote: Hi Guys, I'm using CakePHP and trying to connect to a WSDL SOAP Server created using .NET but until now I'm not able to authenticate by the header. There is any specif way that Cake helps to do that ? Using the SoapUI tool, I'm able to connect and get the results as expected based on this XML input: soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope; xmlns:tem=http://tempuri.org/; soap:Header tem:ValidationHeader !--Optional:-- tem:UserMyUsername/tem:User !--Optional:-- tem:PasswordMyPass/tem:Password /tem:ValidationHeader /soap:Header soap:Body tem:listExamples/ /soap:Body /soap:Envelope Into my controller class, I'm trying public function testSOAP() { $username = ; $password = ; $wsdl=https://myURL?WSDL;; // Setting trace will allow us to view the request that we are making, after we have made it. $objClient = new SoapClient($wsdl, array('trace' = true)); //Body of the Soap Header. $headerbody = array('User' = $username, 'Password' = $password); //Create Soap Header. $header = new SOAPHeader($wsdl, 'ValidationHeader', $headerbody); //set the Headers of Soap Client. $objClient-__setSoapHeaders($header); // Invoke the remote call login(). $Response = $objClient-listExample(); debug($Response); But I'm getting the follow response: System.Web.Services.Protocols.SoapException: Server was unable to process request. --- System.Exception: ServiceX webservice authentication failed. at ServerX2.WebServices.ServerX.listExample() in C:\file.asmx.cs:line 45 --- End of inner exception stack trace --- Using the SoapUI if I change the username and password (to an invalid value) I get the same error message, it means the https protocol is working fine (the client is able to connect to the server) but the SOAP authentication header fails. Any suggestions ? Thanks in advance, -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Problems running Cakephp2.1.1 with SQL Server 2008
Hi, Do you know if the CakePHP 2.1.1 is compatible with SQL Server 2008 ? If yes could you please send me some how to ? I configured my local development environment (PHP 5.3.10 and Apache 2.2.21 on Windows 7) I loaded the extensions pdo_sqlsrv and sqlsrv (on PHP 32 bits, I could not load on PHP 64 bits) I also download and copied the files dbo_sqlsrv.php and DboSource.php into my app/Model/Datasource folder but I'm getting the follow error: Fatal error: Class 'DboSource' not found in C:\wamp\www\project\app\Model\Datasource\dbo_sqlsrv.php on line 29 Is the dbo_sqlsrv.php compatible with Cake 2.1.1 ? Thanks -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Problems running Cakephp2.1.1 with SQL Server 2008
I forgot to say that I'm able to connect and run queries using one test.php file I created without any frameworks (I mean using sqlsrv_connect() direct) so I think the environment configuration is Ok. thanks again On Thu, Apr 12, 2012 at 1:34 PM, Felipe Roman roman.fel...@gmail.com wrote: Hi, Do you know if the CakePHP 2.1.1 is compatible with SQL Server 2008 ? If yes could you please send me some how to ? I configured my local development environment (PHP 5.3.10 and Apache 2.2.21 on Windows 7) I loaded the extensions pdo_sqlsrv and sqlsrv (on PHP 32 bits, I could not load on PHP 64 bits) I also download and copied the files dbo_sqlsrv.php and DboSource.php into my app/Model/Datasource folder but I'm getting the follow error: Fatal error: Class 'DboSource' not found in C:\wamp\www\project\app\Model\Datasource\dbo_sqlsrv.php on line 29 Is the dbo_sqlsrv.php compatible with Cake 2.1.1 ? Thanks -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Problems running Cakephp2.1.1 with SQL Server 2008
Hi Stork, I replaced the dbo_sqlsrv.php by Sqlsrv.php into app/models/datasources and I also replace the database.php settings : from public $default = array( 'datasource' = 'dbo_sqlserver', to public $default = array( 'datasource' = 'Database/Sqlserver', and it is working fine now ;-) Thank you very much On Thu, Apr 12, 2012 at 2:27 PM, stork lubomir.st...@gmail.com wrote: I also download and copied the files dbo_sqlsrv.php and DboSource.php into my app/Model/Datasource folder but I'm getting the follow error: 1. file dbo_sqlsrv.php is for CakePHP 1.x, for 2.x you need this one https://github.com/cakephp/datasources/blob/2.0/Model/Datasource/Database/Sqlsrv.php 2. You shouldn't need to use custom DboSource.php imho. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Controller can't access the Session
After long time trying figure out I found the problem and the solution. I changed the app/config/core.php file setting: Session.checkAgent to false so the Ajax requests do not change the UserAgent allowing the controller to get the session. Session.checkAgent Setting this to TRUE means Cake will store the user agent header of a request when a new session is created. On subsequent request, the user agent header sent is compared with the value stored in the session. If it does not match, the current session will be destroyed and a new session gets created. This rarely causes problem unless you have embedded Flash or Java objects making separate requests to the application. You must take note to send the user agent string of the browser in that case. If you are using something like Aurigma’s Image Uploader where the user agent is not configurable, you have to set this to FALSE instead. Source http://derickng.com/posts/36-cakephp-losing-or-missing-session Thanks On Mar 19, 7:50 am, euromark dereurom...@googlemail.com wrote: why don't your controllers have: public $components = array('Session'); ? without it you cannot use the session component Am Montag, 19. März 2012 01:37:02 UTC+1 schrieb Felipe Roman: Hi, Has someone ever seen only one controller does not access the cake session ? The session works fine for all controllers except for one specific controller. I tried debug the problem but I didn't find the reason. The controller code: class ExecutivosController extends AppController { var $name = 'Executivos'; var $uses = array('Executivo', 'FormacaoAcademica', 'FormacaoComplementar', 'Executivo', 'Empresa', 'Unidade', 'Cargo', 'ExecutivoCargo', 'AtuacaoProfissional', 'ExecutivoIdioma', 'Decisao', 'Mobilidade', 'PotencialProntidao', 'Arquivo', 'Usuario'); var $components = array('RequestHandler', 'Email'); function index() { // Get login information $Login = $this-Session-read('Login'); debug($_SESSION); debug($Login); and the others controllers are similar: ?php class CargosController extends AppController { var $name = 'Cargos'; var $uses = array('Cargo', 'Empresa', 'Unidade', 'Executivo', 'RespostaColaboradore'); var $components = array('RequestHandler', 'Email'); function index() { // Le informações de login $Login = $this-Session-read('Login'); debug($_SESSION); debug($Login); When I access the Cargos controller all session information are printed by debug funcion as expected, when I try access the first one the Session and $_SESSION is empty. If I reload the second one again the session values are still there (it means the session isn't erased). The app_controller.php file: class AppController extends Controller { var $helpers = array('Html', 'Javascript', 'Session', 'Ajax', 'Time', 'Form'); function beforeFilter() { //debug($this); if (($this-name != Usuarios) or ($this-action != 'login')){ if($this-Session-read('Login')) { } else { $this-Session-setFlash(__('Efetue o login para acessar o sistema', true)); $this-redirect(array('controller' = 'usuarios', 'action' = 'login')); } } } Has someone have any ideas why the Executivos controller can't access the session ? Thanks -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedInhttp://au.linkedin.com/in/feliperoman -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Controller can't access the Session
Hi, Has someone ever seen only one controller does not access the cake session ? The session works fine for all controllers except for one specific controller. I tried debug the problem but I didn't find the reason. The controller code: class ExecutivosController extends AppController { var $name = 'Executivos'; var $uses = array('Executivo', 'FormacaoAcademica', 'FormacaoComplementar', 'Executivo', 'Empresa', 'Unidade', 'Cargo', 'ExecutivoCargo', 'AtuacaoProfissional', 'ExecutivoIdioma', 'Decisao', 'Mobilidade', 'PotencialProntidao', 'Arquivo', 'Usuario'); var $components = array('RequestHandler', 'Email'); function index() { // Get login information $Login = $this-Session-read('Login'); debug($_SESSION); debug($Login); and the others controllers are similar: ?php class CargosController extends AppController { var $name = 'Cargos'; var $uses = array('Cargo', 'Empresa', 'Unidade', 'Executivo', 'RespostaColaboradore'); var $components = array('RequestHandler', 'Email'); function index() { // Le informações de login $Login = $this-Session-read('Login'); debug($_SESSION); debug($Login); When I access the Cargos controller all session information are printed by debug funcion as expected, when I try access the first one the Session and $_SESSION is empty. If I reload the second one again the session values are still there (it means the session isn't erased). The app_controller.php file: class AppController extends Controller { var $helpers = array('Html', 'Javascript', 'Session', 'Ajax', 'Time', 'Form'); function beforeFilter() { //debug($this); if (($this-name != Usuarios) or ($this-action != 'login')){ if($this-Session-read('Login')) { } else { $this-Session-setFlash(__('Efetue o login para acessar o sistema', true)); $this-redirect(array('controller' = 'usuarios', 'action' = 'login')); } } } Has someone have any ideas why the Executivos controller can't access the session ? Thanks -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Embedding CakePHP in existing page
Thanks, I quiet feel stupid this doesn't came up to my mind before. But is there any other way? Since with this I wouldn't be able to access sub sites generated by cakePHP just with parent window's URL, without some JS magic, right? On 23 říj, 04:13, Jon Bennett jmbenn...@gmail.com wrote: use an iframe. j On 22 October 2011 18:34, Roman Zawada zwa...@gmail.com wrote: Hi guys, I've voluntiered on creating some db app, and I told those guys that it will be very easy, since I wanted to use CakePHP. Sadly after some time they told me they want it inside their already existing web, which is ancient highly changed PHPNuke. So what I want is to generate just content of one div inside already existing page with CakePHP. I looked up the internets, but or I don't how form proper search query or nothing is out there. I'm rather user of the framework, not developer, so I don't know much about the backend and how MVC frameworks are working inside (and this is my first try with CakePHP, since I'm Rails guy). What I did so far is disabling mod_rewrite for Cake, inside PHPNuke module included cakes index.php and rendering views with empty layout. This somehow works, but the thing is how to form urls. I got it working by now with {{{ http://localhost/modules.php/posts?op=modloadname=xfile=indexd... }}} but with this all links to css and images on phpnuke site are broken. Is there any way to use something like {{{ http://localhost/modules.php?op=modloadname=xfile=indexdo=... }}} or any other way that could do the job. Thank you very much -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- jon bennett -www.jben.net- blog.jben.net -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Embedding CakePHP in existing page
Looks like two simple custom routing classes did the job. Theoretically and in simple test case it works, so hopefully will work in every other situation. On 23 říj, 13:09, Roman Zawada zwa...@gmail.com wrote: Thanks, I quiet feel stupid this doesn't came up to my mind before. But is there any other way? Since with this I wouldn't be able to access sub sites generated by cakePHP just with parent window's URL, without some JS magic, right? On 23 říj, 04:13, Jon Bennett jmbenn...@gmail.com wrote: use an iframe. j On 22 October 2011 18:34, Roman Zawada zwa...@gmail.com wrote: Hi guys, I've voluntiered on creating some db app, and I told those guys that it will be very easy, since I wanted to use CakePHP. Sadly after some time they told me they want it inside their already existing web, which is ancient highly changed PHPNuke. So what I want is to generate just content of one div inside already existing page with CakePHP. I looked up the internets, but or I don't how form proper search query or nothing is out there. I'm rather user of the framework, not developer, so I don't know much about the backend and how MVC frameworks are working inside (and this is my first try with CakePHP, since I'm Rails guy). What I did so far is disabling mod_rewrite for Cake, inside PHPNuke module included cakes index.php and rendering views with empty layout. This somehow works, but the thing is how to form urls. I got it working by now with {{{ http://localhost/modules.php/posts?op=modloadname=xfile=indexd... }}} but with this all links to css and images on phpnuke site are broken. Is there any way to use something like {{{ http://localhost/modules.php?op=modloadname=xfile=indexdo=... }}} or any other way that could do the job. Thank you very much -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- jon bennett -www.jben.net-blog.jben.net -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Embedding CakePHP in existing page
Hi guys, I've voluntiered on creating some db app, and I told those guys that it will be very easy, since I wanted to use CakePHP. Sadly after some time they told me they want it inside their already existing web, which is ancient highly changed PHPNuke. So what I want is to generate just content of one div inside already existing page with CakePHP. I looked up the internets, but or I don't how form proper search query or nothing is out there. I'm rather user of the framework, not developer, so I don't know much about the backend and how MVC frameworks are working inside (and this is my first try with CakePHP, since I'm Rails guy). What I did so far is disabling mod_rewrite for Cake, inside PHPNuke module included cakes index.php and rendering views with empty layout. This somehow works, but the thing is how to form urls. I got it working by now with {{{ http://localhost/modules.php/posts?op=modloadname=xfile=indexdo=x }}} but with this all links to css and images on phpnuke site are broken. Is there any way to use something like {{{ http://localhost/modules.php?op=modloadname=xfile=indexdo=xCakePHP=/posts/bla/bla }}} or any other way that could do the job. Thank you very much -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Scaffolding vs Bake
Hi John, The main difference between scaffold and bake is bake will generate the PHP code (model, controller,view) and you can customize it how you want. When I'm developing I start using bake to generate all CRUD and after I start to change the generated code. If the scaffolding is OK for you (work for all your requirements) I guess you can continue using it. I've read in some place that scaffolding is not recommended to use in production application (I don't remember the reason is unstable or insecure...) but I don't know in the latest cake version. -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: IDE
Hi Kristofer, I've been using NetBeans PHP[1] IDE, there are all IDE common features like code auto-complete, support SVN integration and also other Control Version tools. 1. php.netbeans.org On Tue, Dec 21, 2010 at 12:57 PM, Kristofer krishop...@gmail.com wrote: What IDE do people typically use with CakePHP? I've been doing stuff from the Linux command line using vim for so long. I'd like something more graphical that (hopefully) supports SVN. Looking for more point- and-click. :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: IDE
On Tue, Dec 21, 2010 at 2:28 PM, Kristofer krishop...@gmail.com wrote: Ah, I saw NetBeans several years ago but forgot about it! I will give it another look. Thanks! I got used to use NetBeans for Java development several years ago but this year I started for PHP and it is very good. I've been using Eclipse PHP for a while too. For me both are very good IDEs but a little bit slow(in my computer). -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Keep Pagination options using URL instead of store in a Session
Hello All, This is my first message to this list and I'm beginner using CakePHP. I have a question that I guess is a simple question but till now I didn't find the answer on the internet forums. I'm using pagination component to paginate the result of one search page I created, the problem is when I navigated to next or previous page I lost the search string data. I found some solutions at internet, the first one is using the Session component, I've implemented this solution and it's working fine... but I found some threads on cake forums saying this is not the best way to solve it. Then I found this page saying to add the paginate option as params in the paginate links to include the options in the URL using GET. Is this the best solution ? Then I added on my view the follow line: $paginator-options(array('url'=$this-passedArgs)); Now the params are added in the links, and I changed the search form method to get to add the search string in the URL, the problem is the GET method is adding the value like that: ?param=value (the default get) instead of /controller/method/param:value and the pagination component/helper doesn't add this kind of params in the links. How can I change my form tag to pass the args in the CakePHP format ? I'm creating the search form: echo $form-create(Aluno,array('action' = 'index', 'type' = 'get')); echo $form-input(procurar, array('label' = 'Nome do aluno', 'value' = '')); echo $form-end(Localizar); Thanks advance, -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Advanced setup
Thanks for the response. As you say, the setup was overly complicated, and going back to square one certainly helped. I had followed advice (as I read it, anyway) from the an article on the bakery and moved webroot/index down a level into app, which just confused the situation even if it was not a problem. Also I had rename the cake_1.2.5 directory which does seem to upset the apple- cart. I wanted to do that so that I had nicer looking urls, but I can live with what I have. I have no problems renaming the app dir itself, which is enough for me. As you say, I simply wound up specifing CAKE_CORE_INCLUDE_PATH to point to cake and vendors directories which had been removed to somewhere outside the subversion tree. Many Thanks, Roman. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Advanced setup
Hello, this is my first post so please accept my apologies if I break any conventions. Searches of this site and google at large have not yeilded any results for me, so here goes. I have created a cakePHP site which is to be a sub-system within a larger PHP based intranet. It is hosted on a clients site, to which I have full access. Now, my fellow developer and I use svn source control and so I have been going through the process of making the cake install svn friendly -- splitting of the cake core (cake_1.2.5) to /var/www, having svn ignore the app/tmp directory etc. This is how I have split cake: (from app/index.php) -- if (!defined('ROOT')) { define('ROOT', DS.'var'.DS.'www'.DS.'programmer1'.DS.'main_system'.DS.'cake_systems'); } if (!defined('APP_DIR')) { define('APP_DIR', 'statement_archive'); } if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', DS . 'var' . DS . 'www' . DS . 'cake_1.2.5'); } Note that this file is one of those excluded from svn, my coworker will have the same file but his ROOT will use his initials rather than 'programmer1' so that we each have our own development area. So from the above you can see (or hopefully you cannot see, and that is my problem!) that the cake 'app' directory has been renamed to 'statement_archive' and is a sub directory of 'cake_systems'. The idea is that other modules of the php based system may also be done in cake, and that these would also be sub directories of 'cake_systems' and all would share /var/www/cake_1.2.5. Here is where the problem starts. By setting the route for '/' I can get a correctly displayed (layout and all) screen via the url http://xxx.yyy.aaa.bbb/programmer1/main_system/cake_systems/statement_archive/. This screen provides other links such as -- http://xxx.yyy.aaa.bbb/programmer1/main_system/cake_systems/statement_archive/statements/generate/280060. Clicking on that link gives a 404 not found -- The requested URL / programmer1/main_system/cake_systems/statement_archive/statements/ generate/280060 was not found on this server. Of course, while under development, when the standard 'development style' cake setup (app directory was called 'app' etc) this all worked. It is almost like cakePHP is getting its hands on the url to do its routing, something is beating it to the punch perhaps? To try and get around this I set some routes manually in statement_archive/ config/routes.php - Router::connect('/statements/generate/*', array('controller' = 'statements', 'action' = 'generate')); Router::connect('/statements/view/*', array('controller' = 'statements', 'action' = 'view')); Router::connect('/statements/edit/*', array('controller' = 'statements', 'action' = 'edit')); Router::connect('/statements/delete/*', array('controller' = 'statements', 'action' = 'delete')); Router::connect('/statements/add/*', array('controller' = 'statements', 'action' = 'add')); Router::connect('/logos', array('controller' = 'logos', 'action' = 'index')); Router::connect('/logos/add/*', array('controller' = 'logos', 'action' = 'add')); Router::connect('/statement_controls', array('controller' = 'statement_controls', 'action' = 'index')); Router::connect('/', array('controller' = 'statements', 'action' = 'index')); Any advice as to how and I can links working again? Many Thanks, The Roman. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Encoding problem
finally I found the solution to my problem. It was not the issue with DB either CakePHP. Problem was in PHP - low function. Never use it if you use encoding different than iso-8859-1. Instead of low use mb_strtolower(string, 'UTF-8). Thanks for help. On 15 Wrz, 14:16, brian bally.z...@gmail.com wrote: Also, use a terminal to verify that the data is as it should be. If all you have to work with is PHPMyAdmin, check that its pages are using UTF-8. It's easy, with MySQL, to import UTF-8 data that gets destroyed. If using an import file, put the following at the top: SET NAMES 'utf8'; And, of course, make sure that database.php has 'encoding' = 'utf8' and that your layout has the proper character set meta tag. On Tue, Sep 15, 2009 at 2:06 AM, Sergei yatse...@gmail.com wrote: What DB do you use? It is not CakePHP, it 's DBMS problem. If MySql, set encoding to UTF8 and DB collation to utf8_unicode_ci, not utf8_general_ci. On Sep 15, 5:11 am,Romanroman.janowc...@gmail.com wrote: Hi, I have created filter using paginate with extra options taken from input fields. Service and database use UTF-8 (checked). When I try to filter word with polish characters (e.g. ósma) cakephp does not return proper value. Do you have any idea ? Regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Encoding problem
Hi, I have created filter using paginate with extra options taken from input fields. Service and database use UTF-8 (checked). When I try to filter word with polish characters (e.g. ósma) cakephp does not return proper value. Do you have any idea ? Regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Inserting record with id
Hi, i have a table products with the following columns ( simplified ) id shop_id name id and shop_id are the primary key. Now I have some kind of importer and want to insert data preparing my array like $i['Product']['id'] = $id; $i['Product']['shop_id'] = $shop_id; $i['Product']['name'] = $name; App::import('Model', 'Product' ); $Product = new Product(); $Product-save($i); But it does not save the id, only shop_id and name. I tried to add a fieldList to the save function, but it didn't work. Any help? Thanks for your hints. Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
.htaccess password protect admin routes
Hi, I want to use the admin routes (this works) and protect the requests to e.g. admin/products/edit with .htaccess Given that everything is rewrited there is no real admin folder, so where do I have to place my .htaccess to tell, that users accessing a admin path have to make a normal authentication via .htpasswd files Thanks for your help. Roman To make everything 1000% clear: This is the peace of code of an .htaccess file I am looking a place for ;-) : AuthName Restricted area AuthType Basic AuthUserFile /path/.htpasswd AuthGroupFile /dev/null require valid-user --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Auth: Access denied even when I allow everything
Ricky Paz wrote: If I were you, I would use $this-Auth-allowedActions(' * ') instead of $this-Auth-allow. It works Hi, thanks for your answer, but I got a *Fatal error*: Call to undefined method AuthComponent::allowedActions() in when calling $this-Auth-allowedActions(' * '); Do I have to include something? Thanks a lot, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using Auth: Access denied even when I allow everything
Hi, I am using Auth and most of it works fine. But when I want to call a page directly as http://localhost/products/show/ it says You are not authorized to access that location.. So I went in the products controller and made a function beforeFilter() { $this-Auth-allow('show'); } but it didn't help. Even a change of the AppController didn't make any difference. class AppController extends Controller { var $component = array('Auth'); function beforeFilter() { $this-Auth-allow('*'); //allow every action of every controller } } Do you have any idea why the access is still blocked? Thanks a lot. Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CakePHP validates invalid data
Hi, strange behaviour I got in my register-form. I have a form that collect some basic data: Sourcecode: form id=UsersAddForm method=post action=/rosi/users/add when I submit the form, the output of print_r($this-data) is the following: Array ( [Users] = Array ( [title] = Mr [firstname] = test [surname] = the [email] = hello [username] = world [password] = application [password_confirm] = stuff ) ) Now the application goes into the Users/add action. Here I use the baked version: function add() { if (!empty($this-data)) { $this-User-create(); if ($this-User-save($this-data)) { $this-Session-setFlash(__('The User has been saved', true)); $this-redirect(array('action'='index')); } else { $this-Session-setFlash(__('The User could not be saved. Please, try again.', true, array(), 'register')); } } } Now I have some validation in my Model user.php: class User extends AppModel { var $name = 'User'; var $validate = array( 'firstname' = 'alphanumeric', 'surname' = 'alphanumeric', 'email' = 'email', 'username' = 'alphanumeric', 'password' = 'alphanumeric' ); } Now I would expect the application to NOT save the data, because e.g. the email address ist not valid. But it passes the save action and creates an empty record in the database (except for id, created and modified columns). The columns in the database are named exactly as in the form. So why is cakePHP saying that the invalid data is valid and tries to save it. But even the saving of the data does not work, because he does not save the valid nor the invalid fields. Thanks a lot for your help. Best regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Customizing auth flash messages
Hi, short question and I guess pretty easy for Pros. How can I customize the message from the Auth component. Everything works fine but in case the login fails I got Login failed. Invalid username or password. But I need to change this message. I have to make it shorter to fit in my layout. How and where can I do this? In the login method? Thanks for your help. Best regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Customizing auth flash messages
Perfect!!! Many thanks. This is what I was looking for. Best regards, Roman brian wrote: Set $this-Auth-loginError in AppController::beforeFilter(). On Fri, May 15, 2009 at 10:57 AM, Roman Brunnemann mailingli...@gmx.de wrote: Hi, short question and I guess pretty easy for Pros. How can I customize the message from the Auth component. Everything works fine but in case the login fails I got Login failed. Invalid username or password. But I need to change this message. I have to make it shorter to fit in my layout. How and where can I do this? In the login method? Thanks for your help. Best regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Append something to the Flash message
Hi, short question. I call different methods of a controller on one page request. Most of the functions should write something to the view. I use setFlash for this. But it only shows me the message from the last setFlash call. Is there a way to append something to the existing value? Thanks a lot. Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Get autoincrement ID after save (insert)
Hi, quick question from a newbie. After saving data that will result in a create, I'd like to retrieve the ID from the auto increment field in the database. e.g. I have a database table person with columns id, name, city. Now I create an array $array['Person'] = array( name = John Smith, city = New York ), and call the save-method. Now a new record in the database is generated with a new id from the mysql auto increment function. My question is, how do I get this id, because next thing I'd like to to is to go to the view of this person. Therefor I need the id. Thanks a lot for your help. Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
find with group and two tables
Hi, first of all I am a newbie so this might be a very easy question. But not for me ;-) How can I retrieve data with the find method while grouping and retrieving the maximum value of a second table? The beginning of the Controller class: class InvoicesController extends AppController { var $name = 'Invoices'; var $helpers = array('Html', 'Form'); var $uses = array('Installation'); function index() { $fields = array('Installation.name', 'MAX(Invoice.period_end)' ); $group = array('Installation.id'); $installations = $this-Installation-find('all', array ( 'fields' = $fields, 'group' = $group )); $this-set('installations', $installations ); } When I call this I got the error message: *SQL Error:* 1054: Unknown column 'Invoice.period_end' in 'field list' [*CORE/cake/libs/model/datasources/dbo_source.php*, line *525*] Code javascript:void(0); | Context javascript:void(0); $sql= SELECT `Installation`.`name`, MAX(`Invoice`.`period_end`), `Installation`.`id` FROM `tom_installations` AS `Installation` WHERE `Installation`.`active` = 1 GROUP BY `Installation`.`id` $error = 1054: Unknown column 'Invoice.period_end' in 'field list' $out= null |$out = null;| |if ($error) {| |trigger_error(span style = \color:Red;text-align:left\bSQL Error:/b {$this-error}/span, E_USER_WARNING);| DboSource::showQuery() - CORE/cake/libs/model/datasources/dbo_source.php, line 525 DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 201 DboSource::fetchAll() - CORE/cake/libs/model/datasources/dbo_source.php, line 337 DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php, line 647 Model::find() - CORE/cake/libs/model/model.php, line 1961 InvoicesController::index() - APP/controllers/invoices_controller.php, line 22 Object::dispatchMethod() - CORE/cake/libs/object.php, line 115 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194 [main] - APP/webroot/index.php, line 88 *Query:* SELECT `Installation`.`name`, MAX(`Invoice`.`period_end`), `Installation`.`id` FROM `installations` AS `Installation` WHERE `Installation`.`active` = 1 GROUP BY `Installation`.`id` So cake does not include the Invoice table in the sql query. So how can I do this? Thanks a lot in advance. Best regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CakePHP Pagination and custom URLs
I have a problem with custom URLs and CakePHP pagination. The URL to my news page is www.site.de/de/news Via CakePHP routing, it goes to the News controller and index action. CakePHP pagination now generates these kind of URLs: www.site.de/news/index/page:2 The link works - but due to SEO reasons I want the URL to have the same base as before - like this: www.site.de/de/news/page:2 After reading the documentation I added the following line to change the URL structure of the pagination links: $paginator-options(array('url' = '/de/news')); Unfortunately, the result is this: www.site.de/de/news/index/de/news/page:2 What do I have to change, to tell CakePHP's pagination to only use / de/news as link base -- or just use the current URL as base and only add page:2 at the end? Thanks for your help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CSS Class for th with $html-tableHeaders
With the HTML helper it is easy to set a CSS class for a td: ?php echo $html-tableCells( 'one', array('two',array('class'='myCssClass'), 'three' );? As I understand the documentation, it is only possible to set a CSS class for tr and for all the /th's: ?php echo $html-tableHeaders( array('Date','Title','Active'), array('class' = 'status'), array('class' = 'product_table') );? Is there a way to set a CSS class for a single th? I want table headers for columns which contain numbers to be aligned right, using a CSS class .number --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Is it possible in CakePHP ???
Hi, I am trying to create such a select in Cake: SELECT Month(er.`date`),Year(er.`date`), SUM(er.`value`), er.`position` FROM expense_revenues er where er.`firm_id` = 2 group by 2, 1, 4; how to use SQL functions inside fields Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Apache crashes when using mysql_connect
Hi all. I use Apache 1.3.33 / php-5.2.4 / mysql 5.1.24 / cake_1.1.19.6305 If I define 'connect' = 'mysql_connect' in the database.php and trying to open application in a browser, Windows Shows application crash window: szAppName : Apache.exe szAppVer : 0.0.0.0 szModName : php5ts.dll szModVer : 5.2.4.4 offset : a96a If I define 'connect' = 'mysql_pconnect' - everything works OK. Today I spent a whole day searching for an origin of the bug and tried Apache 1.33, Apache 2, PHP 4.4.8, PHP 5.2.0-5.2.6. It crashes on all PHP version since 5.2.0 (it works with 4.4.8 - but it doesn't connect with mysql 5) Has anyone encountered such bug? Any solutions? -- Best, Roman Onufryk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---