Fop 2.11 - Visual Phonebook

Hey all,

Hopefully this will be an easy one...when I open the phonebook I am greeted with this:
"yes") { die("no way"); } if($context=="") { $addcontext=""; } else { $addcontext="${context}_"; } // Sanitize Input $addcontext = ereg_replace("\.[\.]+", "", $addcontext); $addcontext = ereg_replace("^[\/]+", "", $addcontext); $addcontext = ereg_replace("^[A-Za-z][:\|][\/]?", "", $addcontext); $extension = ereg_replace("'", "", $extension ); $extension = ereg_replace("\"", "", $extension ); $extension = ereg_replace(";", "", $extension ); $grid = new dbgrid($db); $grid->set_table('visual_phonebook'); //$grid->set_caption(trans('Manage Phonebook')); $grid->salt("dldli3ks"); $grid->hide_field('id'); $grid->set_per_page(5); $grid->set_condition("context='$context' AND (owner='$extension' OR (owner<>'$extension' AND private='no'))"); $grid->set_default_values("context",$context); $grid->set_default_values("owner",$extension); $grid->set_input_type("context","hidden"); $grid->set_input_type("owner","hidden"); $grid->no_edit_field("context"); $grid->no_edit_field("owner"); $grid->hide_field('context'); $grid->hide_field('owner'); $grid->edit_field_condition("private",'owner','=',$extension); $fieldname = Array(); $fieldname[]=trans('First Name'); $fieldname[]=trans('Last Name'); $fieldname[]=trans('Company'); $fieldname[]=trans('Phone 1'); $fieldname[]=trans('Phone 2'); $fieldname[]=trans('Private'); $fieldname[]=trans('Picture'); //$grid->set_fields ( "id,firstname,lastname,company,phone1,phone2,owner,private,picture"); $grid->set_display_name( array('firstname','lastname','company','phone1','phone2','private','picture'), $fieldname); $grid->allow_view(true); $grid->allow_edit(true); $grid->allow_delete(true); $grid->allow_add(true); $grid->allow_export(true); $grid->allow_import(true); $grid->allow_search(true); $grid->set_search_fields(array('firstname','lastname','company','phone1','phone2')); $grid->set_input_type('picture','img'); //$grid->set_input_type('owner','select',array($extension,'')); $grid->force_import_field("context",$context); $grid->force_import_field("owner",$extension); $grid->add_display_filter('picture','display_image'); //$grid->add_display_filter('owner','display_private'); //$grid->add_edit_filter('owner','display_private'); $grid->set_user_directory('./uploads/'.$addcontext); //$grid->add_validation_type('email','email'); $grid->show_grid(); function display_image($img) { global $addcontext; if(is_file("./uploads/${addcontext}$img")) { return ""; } else { return "n/a"; } } function display_private($owner) { if($owner=="") { return trans('no'); } else { return trans('yes'); } } ?>

Cannot for the life of me work this out. I have put a fresh copy of the html folder up on the server in the hopes that this would fix it however it still shows this message.


Server is running the following versions of PHP
PHP Version 5.3.2

This is on a CentOS 5.3 server and it is connecting to a MySQL server on another box.

Database has been added correctly and the users configured.

Comments

  • In php.ini set short_open_tag = on and restart apache.
  • That worked perfectly. Thanks a lot. :D
  • You are welcome, I will use the standard php tags on the next release to avoid this issue. It seems that some newer linux distributions are not enabling short tags for php by default.
  • I have same problem!
    CentOS 5.5
    PHP 5.2.10 (short_open_tag = On)
    FOP 2.20
  • Hi,

    I do not think you have the same problem. FOP 2.20 does not use short tags anymore. So please explain a little bit better what do you see and what happens. If you see php code when loading the phonebook, then it is probably your web server does not have php support enabled.
  • PHP is enabled i followed instructions on http://wiki.centos.org/HowTos/PHP_5.1_To_5.2, and my test page is fine!

    This is what i get after click on Phonebook link:
    $page_title>\n"; } else { echo " \n"; } ?>
    "yes") { die("no way"); } if($context=="") { $addcontext=""; } else { $addcontext="${context}_"; } // Sanitize Input $addcontext = ereg_replace("\.[\.]+", "", $addcontext); $addcontext = ereg_replace("^[\/]+", "", $addcontext); $addcontext = ereg_replace("^[A-Za-z][:\|][\/]?", "", $addcontext); $extension = ereg_replace("'", "", $extension ); $extension = ereg_replace("\"", "", $extension ); $extension = ereg_replace(";", "", $extension ); $grid = new dbgrid($db); $grid->set_table('visual_phonebook'); //$grid->set_caption(trans('Manage Phonebook')); $grid->salt("dldli3ks"); $grid->hide_field('id'); $grid->set_per_page(5); $grid->set_condition("context='$context' AND (owner='$extension' OR (owner<>'$extension' AND private='no'))"); $grid->set_default_values("context",$context); $grid->set_default_values("owner",$extension); $grid->set_input_type("context","hidden"); $grid->set_input_type("owner","hidden"); $grid->no_edit_field("context"); $grid->no_edit_field("owner"); $grid->hide_field('context'); $grid->hide_field('owner'); $grid->edit_field_condition("private",'owner','=',$extension); $fieldname = Array(); $fieldname[]=trans('First Name'); $fieldname[]=trans('Last Name'); $fieldname[]=trans('Company'); $fieldname[]=trans('Phone 1'); $fieldname[]=trans('Phone 2'); $fieldname[]=trans('Private'); $fieldname[]=trans('Picture'); //$grid->set_fields ( "id,firstname,lastname,company,phone1,phone2,owner,private,picture"); $grid->set_display_name( array('firstname','lastname','company','phone1','phone2','private','picture'), $fieldname); $grid->allow_view(true); $grid->allow_edit(true); $grid->allow_delete(true); $grid->allow_add(true); $grid->allow_export(true); $grid->allow_import(true); $grid->allow_search(true); $grid->set_search_fields(array('firstname','lastname','company','phone1','phone2')); $grid->set_input_type('picture','img'); //$grid->set_input_type('owner','select',array($extension,'')); $grid->force_import_field("context",$context); $grid->force_import_field("owner",$extension); $grid->add_display_filter('picture','display_image'); $grid->add_display_filter('phone1','clickdial'); $grid->add_display_filter('phone2','clickdial'); //$grid->add_display_filter('owner','display_private'); //$grid->add_edit_filter('owner','display_private'); $grid->set_user_directory('./uploads/'.$addcontext); //$grid->add_validation_type('email','email'); $grid->show_grid(); function display_image($img) { global $addcontext; if(is_file("./uploads/${addcontext}$img")) { return ""; } else { return "n/a"; } } function display_private($owner) { if($owner=="") { return trans('no'); } else { return trans('yes'); } } function clickdial($number) { return "$number"; } ?>
    
  • If php is configured correctly and you are looking at fop 2.20 visual phonebook, then it must work. From your post it seems you are having php installation issues. I cannot help you much, perhaps you can write a short php file in fop2 directory info.php
    <?php
    phpinfo();
    ?>
    

    and see if it works. Perhaps you have mixed php versions installed, or the php.ini file is not in the place you think it should be, or you are loading fop2.11 phonebook and you still do not have short tags enabled.

    If you see the php info page with the above script, check the location of the php.ini file and the status of short_open_tag
  • Just an idea, perhaps you broke config.php when putting the credentials.. be sure you do not have errors there and that the php tags are present.
Sign In or Register to comment.