zend-framework

Zend_Auth best practices

这一生的挚爱 提交于 2019-12-18 17:33:20
问题 My goal is to require login for certain pages. I am using Zend Framework MVC, and I'm trying to find examples regarding best practices. Some notes on what I'm looking for: I want non-logged in users to get a login box, and then return to logged in version of the page, once authenticated I want to use dependency injection, and avoid singletons Small code footprint - tie into Zend mvc structure Should login box be a separate controller and do header redirect? How to return to landing page after

Zend_Mail sent email is treated as SPAM

空扰寡人 提交于 2019-12-18 16:55:30
问题 Please tell me what I am doing wrong. I am sending an email using the Zend_Mail class like this: $message = <<<STR You have a new invoice! Sign in to your clientarea to see it. Best regards, Company name STR; $mail = new Zend_Mail(); $mail->setBodyText($message); $mail->setFrom('billing@company.com', 'Company.com'); $mail->addTo('client@email.com', 'Client Name'); $mail->setSubject('You have a new invoice!'); $mail->send(); It is received as a spam though. There are other applications such as

Using Zend_Auth to secure all controllers

大憨熊 提交于 2019-12-18 16:54:55
问题 How would i globally secure all my controllers (except for my Login controller) to ensure my application is secure at all points (no hidden backdoor to ajax calls, etc). I thought that I might put it in my bootstrap file, but this doesn't feel right? I'm trying to avoid adding any code to each controller. Suggestions? 回答1: edit : this is a complement of @singles response. You must understand there are 2 different things. Auth and Acl . Auth tells you who is the user, and you can for example

Using Zend_Auth to secure all controllers

陌路散爱 提交于 2019-12-18 16:54:03
问题 How would i globally secure all my controllers (except for my Login controller) to ensure my application is secure at all points (no hidden backdoor to ajax calls, etc). I thought that I might put it in my bootstrap file, but this doesn't feel right? I'm trying to avoid adding any code to each controller. Suggestions? 回答1: edit : this is a complement of @singles response. You must understand there are 2 different things. Auth and Acl . Auth tells you who is the user, and you can for example

SOAP-ERROR: Encoding: string … is not a valid utf-8 string

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 16:52:32
问题 Hi I have a web service built using the Zend Framework. One of the methods is intended to send details about an order. I ran into some encoding issue. One of the values being returned contains the following: Jaime Torres Bodet #322-A Col. Lomas de Santa María The webservice is returning the following fault: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>SOAP-ERROR: Encoding:

Multiple Zend framework sites on one server

倖福魔咒の 提交于 2019-12-18 16:48:49
问题 I'm having trouble setting up my httpd.conf or .htaccess files to recognize multiple zend framework sites on one server. For development, I have just one server and I'm trying to setup the sites so I can access them like localhost/app1, localhost/app2, etc. So right now, when I go to localhost/app1 it does successfully redirect to localhost/app1/public/index.php, however when I go to localhost/app1/index/index I get a 404. Here is my vhosts file: <VirtualHost *:80> ServerAdmin webmaster

Multiple Zend framework sites on one server

旧巷老猫 提交于 2019-12-18 16:48:30
问题 I'm having trouble setting up my httpd.conf or .htaccess files to recognize multiple zend framework sites on one server. For development, I have just one server and I'm trying to setup the sites so I can access them like localhost/app1, localhost/app2, etc. So right now, when I go to localhost/app1 it does successfully redirect to localhost/app1/public/index.php, however when I go to localhost/app1/index/index I get a 404. Here is my vhosts file: <VirtualHost *:80> ServerAdmin webmaster

Where does Zend_Form fit in the Model View Controller paradigma

此生再无相见时 提交于 2019-12-18 16:31:29
问题 The Zend Framework is mainly meant for MVC use. One of the very usefull components is Zend_Form. I have a bit trouble finding the place of Zend_Form. Is it part of the view, model, or controller and which responsibilities should I give it. The thing is, Zend_Form does two things: decorate and render the form and validate it. The first is a real view task, the second a real model task. Now the most common use seems to be to have the forms interact with the controller only, effectively putting

Master / Slave switch in the Zend Framework application layer

泄露秘密 提交于 2019-12-18 16:10:56
问题 I am writing an application which requires the Master/Slave switch to happen inside the application layer. As it is right now, I instantiate a Zend_Db_Table object on creation of the mapper, and then setDefaultAdapter to the slave. Now inside of the base mapper classe, I have the following method: public function useWriteAdapter() { if(Zend_Db_Table_Abstract::getDefaultAdapter() != $this->_writeDb) { Zend_Db_Table_Abstract::setDefaultAdapter($this->_writeDb); $this->_tableGateway = new Zend

Deprecated: Retrieve service locator in functional system - ZF2

大憨熊 提交于 2019-12-18 15:55:11
问题 I'm developing a ZF2 system and it was working very well, but after I clone the repository in other computer this deprecated error has appeared: You are retrieving the service locator from within the class Module\Controller\Controller. Please be aware that ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along with the ServiceLocatorAwareInitializer. You will need to update your class to accept all dependencies at creation, either via constructor arguments or