included file is not parsed/evaled in joomla

For Joomla! 2.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Note: All 1.6, 1.7 and 3.5 releases have reached end of life and should be updated to 3.x.

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
saco721
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Mon Feb 23, 2009 12:13 pm

included file is not parsed/evaled in joomla

Postby saco721 » Fri Oct 13, 2017 9:55 am

Hi,
I have IPSconfig 3.1.6 multiserver setup with Joomla 2.5.11, I have a standard add_client.php script that I am trying to get working in joomla. The script works as it should but appears as a standard html page rather than a page within joomla cms, all the remoting scripts that I have tried produce the same result. What can I try to resolve this problem? I have attached the script below.

Code: Select all

<?php

require 'soap_config.php';


$client = new SoapClient(null, array('location' => $soap_location,
        'uri'      => $soap_uri,
        'trace' => 1,
        'exceptions' => 1));


try {
    if($session_id = $client->login($username, $password)) {
        echo 'Logged successfull. Session ID:'.$session_id.'<br />';
    }

    //* Set the function parameters.
    $reseller_id = 0; // this id has to be 0 if the client shall not be assigned to admin or if the client is a reseller
    $params = array(
        'company_name' => 'awesomecompany',
        'contact_name' => 'name',
        'customer_no' => '1',
        'vat_id' => '1',
        'street' => 'fleetstreet',
        'zip' => '21337',
        'city' => 'london',
        'state' => 'bavaria',
        'country' => 'GB',
        'telephone' => '123456789',
        'mobile' => '987654321',
        'fax' => '546718293',
        'email' => 'e@mail.int',
        'internet' => '',
        'icq' => '111111111',
        'notes' => 'awesome',
        'default_mailserver' => 1,
        'limit_maildomain' => -1,
        'limit_mailbox' => -1,
        'limit_mailalias' => -1,
        'limit_mailaliasdomain' => -1,
        'limit_mailforward' => -1,
        'limit_mailcatchall' => -1,
        'limit_mailrouting' => 0,
        'limit_mailfilter' => -1,
        'limit_fetchmail' => -1,
        'limit_mailquota' => -1,
        'limit_spamfilter_wblist' => 0,
        'limit_spamfilter_user' => 0,
        'limit_spamfilter_policy' => 1,
        'default_webserver' => 1,
        'limit_web_ip' => '',
        'limit_web_domain' => -1,
        'limit_web_quota' => -1,
        'web_php_options' => 'no,fast-cgi,cgi,mod,suphp',
        'limit_web_subdomain' => -1,
        'limit_web_aliasdomain' => -1,
        'limit_ftp_user' => -1,
        'limit_shell_user' => 0,
        'ssh_chroot' => 'no,jailkit,ssh-chroot',
        'limit_webdav_user' => 0,
        'default_dnsserver' => 1,
        'limit_dns_zone' => -1,
        'limit_dns_slave_zone' => -1,
        'limit_dns_record' => -1,
        'default_dbserver' => 1,
        'limit_database' => -1,
        'limit_cron' => 0,
        'limit_cron_type' => 'url',
        'limit_cron_frequency' => 5,
        'limit_traffic_quota' => -1,
        'limit_client' => 0, // If this value is > 0, then the client is a reseller
        'parent_client_id' => 0,
        'username' => 'guy3',
        'password' => 'brush',
        'language' => 'en',
        'usertheme' => 'default',
        'template_master' => 0,
        'template_additional' => '',
        'created_at' => 0
    );

    $affected_rows = $client->client_add($session_id, $reseller_id, $params);

    echo "Client: ".$affected_rows."<br>";


    if($client->logout($session_id)) {
        echo 'Logged out.<br />';
    }


} catch (SoapFault $e) {
    echo $client->__getLastResponse();
    die('SOAP Error: '.$e->getMessage());
}

?>


Thanks for any advice.
Last edited by imanickam on Fri Oct 13, 2017 12:09 pm, edited 1 time in total.
Reason: Moved the topic from the forum General Questions/New to Joomla! 2.5 to the forum Joomla! 2.5 Coding

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 23675
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: included file is not parsed/evaled in joomla

Postby Per Yngve Berg » Sun Oct 15, 2017 7:28 pm

1) Your Joomla is severely outdated. The version 2.5.28 was released on December 2014. The current version is 3.8.1.

2) Where are you entering the code? Are you developing your own component?

saco721
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Mon Feb 23, 2009 12:13 pm

Re: included file is not parsed/evaled in joomla

Postby saco721 » Mon Oct 16, 2017 3:47 pm

Hi Per Yngve Berg,

Thanks very much for getting back to me!, Basically what i'm trying to accomplish is to add a new client to ISPConfig (a web hosting platform). The standard code I included in my post works fine as a standard php script, but I need it to work in Joomla. I have tried adding source code using sorceror and jumi, both produce exactly the same result (the html is rendered outside of Joomla). I have experimented with the script (add_client.php) and it looks like the line soap_config.php seems to be the problem, but I dont know how to fix it. I am aware that the version of Joomla I have is very outdated, Once I get the script to work I will update to 3.8.1. Please let me know if you need any more information to help resolve this issue, Best wishes, Saco.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 23675
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: included file is not parsed/evaled in joomla

Postby Per Yngve Berg » Tue Oct 17, 2017 3:19 pm

Is the path to 'soap_config.php' correct?

saco721
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Mon Feb 23, 2009 12:13 pm

Re: included file is not parsed/evaled in joomla

Postby saco721 » Tue Oct 17, 2017 6:21 pm

Yes, it resides in the same directory as add_client.php.

saco721
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Mon Feb 23, 2009 12:13 pm

Re: included file is not parsed/evaled in joomla

Postby saco721 » Wed Oct 18, 2017 2:26 pm

Sorry my mistake, soap_config.php is in the correct directory, because if I move it, or change its name in the jumi add client component i.e :

require 'soap_config.php';


to

require 'soap_configs.php';


The script no longer runs soap_config.php as expected, and I get a HTTP ERROR 500.


Return to “Joomla! 2.5 Coding”

Who is online

Users browsing this forum: No registered users and 1 guest