[kwlug-disc] PHP code question

Bill Traynor btraynor at gmail.com
Wed Sep 7 15:06:11 EDT 2011


On Wed, Sep 7, 2011 at 15:04, Bill Traynor <btraynor at gmail.com> wrote:

>
>
> On Wed, Sep 7, 2011 at 14:57, Khalid Baheyeldin <kb at 2bits.com> wrote:
>
>> > Unexpected character in input:  ''' (ASCII=39) state=1
>>
>> That is a single quote, delimiter for a string or something.
>>
>> Are you sure it is only for the path member/register that this manifests
>> itself?
>>
>> Change the function to be like this:
>>
>>
>> function ctools_php_ctools_access_check($__conf, $contexts) {
>>   if (arg(0) == 'member' && arg(1) == 'register') {
>>     print_r($__conf);
>>   }
>>
>>   $access = eval($__conf['php']);
>>   return $access;
>> }
>>
>> This should display and array and 'php' will be one element of it.
>>
>
> Thanks Khalid, this is what the code produced:
>
> Array ( [description] => [php] => if ( arg(0) == 'user' &&
> is_numeric(arg(1)) && arg(2) == 'openid') { return TRUE; }; ) Array (
> [description] => [php] => if ((arg(0) == 'node' && arg(1) == 'agreement' &&
> is_numeric(arg(2))) || arg(0)=='project' || (arg(0) == 'node' &&
> is_numeric(arg(1)) && arg(2) == 'release') || arg(0) == 'comment' ) { return
> true; } ) Array ( [description] => [php] => if ( arg(0) == 'messages' || (
> arg(0) == 'filter' && arg(1) == 'tips) ) { return TRUE; }; ) Array (
> [description] => [php] => if (arg(0) == 'search' && arg(1) == 'user'){
> return TRUE; } ) Array ( [description] => [php] => if((arg(0)== 'search' &&
> arg(1) == 'apachesolr_search')){ return TRUE; } ) Array ( [description] =>
> notification pages [php] => if ((arg(0) == 'user' && is_numeric(arg(1)) &&
> arg(2) == 'notifications') || (arg(0) == 'notifications')){ return TRUE; } )
> Array ( [description] => [php] => if ((arg(0) == 'invite') || (arg(0) ==
> 'user' && arg(2) == 'invites')){ return true; } )
>
> Attempting to decipher now.
>
>
This looks suspect:

&& arg(1) == 'tips)



>
>
>> --
>> Khalid M. Baheyeldin
>> 2bits.com, Inc.
>> http://2bits.com
>> Drupal optimization, development, customization and consulting.
>> Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
>> Simplicity is the ultimate sophistication. --   Leonardo da Vinci
>>
>> _______________________________________________
>> kwlug-disc mailing list
>> kwlug-disc at kwlug.org
>> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20110907/b790709a/attachment.htm>


More information about the kwlug-disc mailing list