2010年12月17日星期五

Re: [fw-mvc] problem in Zend_Auth_HTTP

It looks like you're authenticating, but not storing the results of that
authentication anywhere. I'm not sure if the HTTP authentication is any
different from the others, but I believe you need to use Zend_Auth's
authenticate method instead of calling it on the adapter directly:

$auth = Zend_Auth::getInstance();
$auth->setStorage(new Zend_Auth_Storage_Session('somenamespace'));
$result = $auth->authenticate($adapter);

Internally, Zend_Auth will call the authenticate() method on your adapter,
and if successful store the results in the storage adapter. This will allow
you to check for authentication on the next request without having to set up
your HTTP adapter all over again:

// next request
$auth = Zend_Auth::getInstance();
$auth->setStorage(new Zend_Auth_Storage_Session('somenamespace'));
if ($auth->hasIdentity()) {
// logged in
$identity = $auth->getIdentity();
} else {
// not logged in
}

I hope this helps.

--
*Hector Virgen*
Sr. Web Developer
http://www.virgentech.com

On Thu, Dec 16, 2010 at 11:45 PM, sina miandashti <miandashti@gmail.com>wrote:

> hey alll :)
>
> i want to use this on my AdminController.php
> so in public init() i wrote this :
>
> $config = array(
> 'accept_schemes' => 'basic digest',
> 'realm' => 'My Web Site',
> 'digest_domains' => '/members_only /my_account',
> 'nonce_timeout' => 3600,
> );
> $adapter = new Zend_Auth_Adapter_Http($config);
>
> $basicResolver = new Zend_Auth_Adapter_Http_Resolver_File();
>
> $basicResolver->setFile(APPLICATION_PATH.'\basicPasswd.txt');
>
>
> $adapter->setBasicResolver($basicResolver);
>
>
>
> $adapter->setRequest($this->_request);
>
> $adapter->setResponse($this->_response);
>
> $result = $adapter->authenticate();
>
> if (!$result->isValid()) {
> throw new Zend_Exception("You Dont have access to admin area");
> } else {
> die('u have access');
> }
>
>
>
> *and in my password file :
> admin:827ccb0eea8a706c4c34a16891f84e7b
>
> *the above pass is md5 of '12345'
>
>
>
> the problem is it request for password again and again also when u type
> the correct user password.
> :(
>
> i think it cannot match the userpass from password file
> how to fix it?
>
> --
> ________________
> Sincerely
> Sina Miandashti
> MuSicBasE.ir & InvisionPower.ir Admin
>

[fw-mvc] Re: Redirector helper bypasses postDispatch?

Found the solution and posted about it: http://bit.ly/gvL3Pl

-----
Kyle Spraggs
www.blitzaroo.com
blogs @ www.spiffyjr.me
follow me @ www.twitter.com/kspraggs
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Redirector-helper-bypasses-postDispatch-tp3092123p3092606.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年12月16日星期四

[fw-mvc] problem in Zend_Auth_HTTP

hey alll :)

i want to use this on my AdminController.php
so in public init() i wrote this :

$config = array(
'accept_schemes' => 'basic digest',
'realm' => 'My Web Site',
'digest_domains' => '/members_only /my_account',
'nonce_timeout' => 3600,
);
$adapter = new Zend_Auth_Adapter_Http($config);

$basicResolver = new Zend_Auth_Adapter_Http_Resolver_File();

$basicResolver->setFile(APPLICATION_PATH.'\basicPasswd.txt');


$adapter->setBasicResolver($basicResolver);

$adapter->setRequest($this->_request);

$adapter->setResponse($this->_response);

$result = $adapter->authenticate();

if (!$result->isValid()) {
throw new Zend_Exception("You Dont have access to admin area");
} else {
die('u have access');
}

*and in my password file :
admin:827ccb0eea8a706c4c34a16891f84e7b

*the above pass is md5 of '12345'

the problem is it request for password again and again also when u type
the correct user password.
:(

i think it cannot match the userpass from password file
how to fix it?

--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin

[fw-mvc] Re: Table query error: the pk exists but query errors...

UPDATE: very sorry! I WAS using the wrong database! Eeesh, I need to
look more carefully next time. Apologies to anyone who looked at this
for me!

--regards,
nathan

On Thu, Dec 16, 2010 at 12:33 PM, Nathan Garlington <garlinto@gmail.com> wrote:
> I was wondering if any of you have encountered an error similar to the
> one I have been experiencing. I am using ZF-1.11.1 and the pdo_pgsql
> driver to connect to a postgresql-9.0.1 database.
> The error:
>
> "Primary key column(s) (author_id) are not columns in this table ()"
>
> I have checked to make sure that I am on the right database. The table
> is the 'authors' table and looks like this:
>
> CREATE TABLE authors (
>    author_id integer NOT NULL,
>    display_name text NOT NULL,
>    name text NOT NULL
> );
>
> CREATE SEQUENCE authors_author_id_seq
>    START WITH 1
>    INCREMENT BY 1
>    NO MINVALUE
>    NO MAXVALUE
>    CACHE 1;
>
> ALTER TABLE ONLY authors
>    ADD CONSTRAINT authors_pkey PRIMARY KEY (author_id);
>
> The permissions have been setup correctly. I don't understand why the
> $this->_table->fetchAll(); errors out on this. I can manually run the
> SQL from the command line against the table successfully:
>
>     'select authors.* from public.authors;'
>
> And no problems, lists all 4 tuples from the table. Is there something
> wrong with the way I am trying to run the "fetchAll" method? I have
> this same problem on a categories table as well. Very confounding.
>
> --regards,
> nathan
>

[fw-mvc] Table query error: the pk exists but query errors...

I was wondering if any of you have encountered an error similar to the
one I have been experiencing. I am using ZF-1.11.1 and the pdo_pgsql
driver to connect to a postgresql-9.0.1 database.
The error:

"Primary key column(s) (author_id) are not columns in this table ()"

I have checked to make sure that I am on the right database. The table
is the 'authors' table and looks like this:

CREATE TABLE authors (
author_id integer NOT NULL,
display_name text NOT NULL,
name text NOT NULL
);

CREATE SEQUENCE authors_author_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER TABLE ONLY authors
ADD CONSTRAINT authors_pkey PRIMARY KEY (author_id);

The permissions have been setup correctly. I don't understand why the
$this->_table->fetchAll(); errors out on this. I can manually run the
SQL from the command line against the table successfully:

'select authors.* from public.authors;'

And no problems, lists all 4 tuples from the table. Is there something
wrong with the way I am trying to run the "fetchAll" method? I have
this same problem on a categories table as well. Very confounding.

--regards,
nathan

[fw-gdata] Re: Zend_GData_Docs support of pdf content-type

Hi Ryan,
Thanks for your reply.
For fix it, first i've added the line 'PDF' => 'application/pdf' to the
static property $SUPPORTED_FILETYPES.
But, the pdf file format could be upload only with the gdata Version 3.0.
That's why I asked for an official solution, and not a patch made by myself
:D

I've found a rebuild of the Zend_GData_Docs on the net, which implements the
protocol version to use when calling google document api.
That's why I was surprise that the last version of GData didn't implement
it.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-GData-Docs-support-of-pdf-content-type-tp3090977p3091262.html
Sent from the Zend gdata mailing list archive at Nabble.com.

Re: [fw-gdata] Zend_GData_Docs support of pdf content-type

Hi Benoit,

I'm not aware of any development going on in this area. You're welcome to
contribute via:
http://framework.zend.com/community/contribute

I believe you should be able to use Zend_Gdata_Docs::uploadFile, passing the
appropriate mime type and URL to upload to, though I haven't tried so
myself.

Cheers,
-Ryan

On Thu, Dec 16, 2010 at 6:34 AM, benoit <benoit.delporte@gmail.com> wrote:

>
> Hi all,
>
> I download the latest version of gdata, and the pdf content type is not
> support to upload. But, on the google documentation, the type is supported
> (and other that gdata doesn't support).
>
> So i found a Zend_Gdata_Docs that implement it, but i would like to know
> when it will be implemented in the official release.
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Zend-GData-Docs-support-of-pdf-content-type-tp3090977p3090977.html
> Sent from the Zend gdata mailing list archive at Nabble.com.
>