undefined method Sanitize::sql()

2008-10-21 Thread Nelson Cysneros


While trying to run the IBM's "Cook up Web sites fast with CakePHP"
tutorial, I get the following error message.

Fatal error: Call to undefined method Sanitize::sql() in C:\wamp\www
\tor\app\controllers\users_controller.php on line 18

Every thing works until I add the Sanitize::sql methods.  I'm using
the tutorial code sample to run it, using Cakephp 1.2.0.7296-rc2.

Reading through the newgroup, it sounds like we no longer need to use
the Sanatize method. Its done automatically for you when you save...
Can anyone verify this?  Should the tutorial code work anyway?  Any
suggestions?

Thanks.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Memory leakage

2008-09-04 Thread Nelson Cysneros

Di,

Make sure you don't have any white spaces after your model's or
controller's closing bracket.  If you do remove it and see if that
fixes it.

Regards

On Sep 4, 2:04 pm, Dianne  van Dulken <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was wondering if anyone had come across this before.  I'm having a
> major  problem with memory leakage.   It seems to be related to a
> header already set and thus cannot send session_start warning that i
> get.
>
> The warning is below (and also the memory leak)
>
> 7. at end of cakephp findAll id: configuration : we're using (in
> bytes): 4892936
>
> Warning (2): session_start() [function.session-start]: Cannot send
> session cache limiter - headers already sent (output started at D:\www
> \cake_1.2.x.x\cake\libs\model\model.php:1498) [CORE\cake\libs
> \session.php, line 155]
>
> Context | Code
>             $this->__initSession();
>             session_cache_limiter ("must-revalidate");
>             session_start();
>             header ('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP
> IND DEM"');
> session_start - [internal], line ??
> CakeSession::__construct() - CORE\cake\libs\session.php, line 155
> SessionComponent::__construct() - CORE\cake\libs\controller\components
> \session.php, line 54
> Component::_loadComponents() - CORE\cake\libs\controller
> \component.php, line 132
> Component::init() - CORE\cake\libs\controller\component.php, line 66
> Controller::_initComponents() - CORE\cake\libs\controller
> \controller.php, line 319
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 230
> [main] - APP\webroot\index.php, line 84
>
> Warning (2): Cannot modify header information - headers already sent
> by (output started at D:\www\cake_1.2.x.x\cake\libs\model\model.php:
> 1498) [CORE\cake\libs\session.php, line 156]
>
> Context | Code
>
>             $this->__initSession();
>             session_cache_limiter ("must-revalidate");
>             session_start();
>             header ('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP
> IND DEM"');
>             $this->__checkValid();
> header - [internal], line ??
> CakeSession::__construct() - CORE\cake\libs\session.php, line 156
> SessionComponent::__construct() - CORE\cake\libs\controller\components
> \session.php, line 54
> Component::_loadComponents() - CORE\cake\libs\controller
> \component.php, line 132
> Component::init() - CORE\cake\libs\controller\component.php, line 66
> Controller::_initComponents() - CORE\cake\libs\controller
> \controller.php, line 319
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 230
> [main] - APP\webroot\index.php, line 84
>
> 1. Within cakephp findAll id: position : we're using (in bytes):
> 8085512
>
> I'm not sure what I should be doing as the errors seem to be within
> the core cake functionality.
>
> Has anyone come across this before, and if so, how did they fix it?
>
> Thanks
>
> Di
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Session : Single Sign on from other application

2008-04-18 Thread Nelson Cysneros

have you looked at this thread?

getting cake DB session to an external application:

http://groups.google.com/group/cake-php/browse_thread/thread/5a868ad24cff1c83/3127e7971078becf?lnk=gst&q=cysneros#3127e7971078becf

On Apr 18, 1:40 am, acl68 <[EMAIL PROTECTED]> wrote:
> Hello everybody,
>
> I was programming an application with Cake and all was well ;-)
> Then my colleague and I had the idea to share the login procedure with
> the applications he is maintining, so that the login in his
> application and the information should be passed on to my cake
> application -> Single Sign On for our users!
>
> Now I have deep trouble to get those two applications to work
> together. Using the user table from the other database was simple, but
> checking whether somebody has already logged on is what I don't get to
> work. The Userinformation is in the common user table, but how can I
> load the userinformation in my application without an additional
> login?
>
> Has anyone an idea?
>
> My ideas are:
> 1. Switch Cake session handling completely off and use the session
> objects of the general application. But how can I do that?
>
> 2. Transfer the information from Object/Session_otheraplication to
> Object/Session_myCakeapplication . But how can I achieve this? To make
> things worse, both varaiable in which teh Sessiondata ist stored are
> called $session.
>
> The Non-Cake application is the leading application so I cannot change
> anything / much there.
>
> Thanks in advance for any hints and ideas!
>
> Anja
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: getting cake DB session to an external application

2008-03-30 Thread Nelson Cysneros

This is how I got it working.

//To get the correct session ID use:

$sid = $_COOKIE['CAKEPHP'];

//To get and parse the data

$sql = "SELECT data FROM $app_session_table s WHERE s.id = '$sid' ";
$res = dbi_query($sql);
$variables = array(  );

$record = mysql_fetch_array($res);
$myData = $record[0];
$uid= NULL;

$a = preg_split( "/(\w+)\|/", $myData, -1,PREG_SPLIT_NO_EMPTY |
PREG_SPLIT_DELIM_CAPTURE );
for( $i = 0; $i < count( $a ); $i = $i+2 ) {
$variables[$a[$i]] = unserialize( $a[$i+1] );
}

//All session arrays are now contained in our variables array.
   //Get the array you want with the proper key.
$myData =   $variables['User'];

   //All the User session data is now in the myData array.  Use the
   //session key to get the value you want.
   $uid = $myData['username'];
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: Parsing a cakephp session Data row

2008-03-29 Thread Nelson Cysneros

Thanks for your repleys.  I got it working.
This is how I got it to work. Comments welcome.

 $sql = "SELECT data FROM $app_session_table s WHERE s.id = '$sid' ";
$res = dbi_query($sql);
$variables = array(  );

$record = mysql_fetch_array($res);
$myData = $record[0];
$uid= NULL;

$a = preg_split( "/(\w+)\|/", $myData, -1,PREG_SPLIT_NO_EMPTY |
PREG_SPLIT_DELIM_CAPTURE );
for( $i = 0; $i < count( $a ); $i = $i+2 ) {
$variables[$a[$i]] = unserialize( $a[$i+1] );
}

//All session arrays are now contained in our variables array.
Get the array you want with the proper key.
$myData =   $variables['User'];

   //All the User session data is now in the myData array.  Use the
session key to get the value you want.
   $uid = $myData['username'];
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Parsing a cakephp session Data row

2008-03-28 Thread Nelson Cysneros

I'm getting the data column from the session table (DB session option)
and it looks something like this:



Config|a:3:{s:4:"rand";i:6637528;s:4:"time";i:1179...

How can I parse this to get the session variables I need.
I need this for an external application, so I can't use cake methods,
but if someone can point me to the function cake uses to parse this,
that will help a lot.

Thanks



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---