Signup Client, the Agentnum

Albert Whale aewhale at ABS-CompTech.com
Tue Mar 29 12:31:03 PST 2005


Albert Whale wrote:

> Scott Edwards wrote:
>
>>>>> Is there a way to display only selected packages in the signup pages?
>>>>>       
>>>>
>>>> Yes there is.
>>>>     
>>>
>>> Great, can you please share how to do this?
>>>   
>>
>>
Ok, following up my own Thread,

http://www.sisd.com/freeside/docs/selfservice.html discusses the Self 
Service Daemon.

The Section 

    * Run an instance of

freeside-selfservice-server user machine agentnum refnum

      on the Freeside machine for each external machine.
          o user is a user from the mapsecrets file.
          o machine is the name of the external machine.

Stops short of describing the agentnum and refnum components of the 
Command line, however gleaning what I can glean from the information 
above is the following:

    * Set the signup_server-default_agentnum
      <http://www.sisd.com/freeside/config/config.cgi#unclassified>
      configuration value to a default agent number
      <http://www.sisd.com/freeside/browse/agent.cgi>.
    * Set the signup_server-default_refnum
      <http://www.sisd.com/freeside/config/config.cgi#unclassified> to a
      default advertising source
      <http://www.sisd.com/freeside/browse/part_referral.cgi>.

So, the question still becomes, How do I interface Multiple Signup.cgi's 
(on the same system, different virtual hosts) to the Freeside Server and 
present different package data back to the signup.cgi?

All of the signup.cgi's will reside on the same 
freeside-selfservice-server as different Virtual Hosts.

Can anyone please explain to me what needs to be done?

I believe that there will be multiple instances od the self-service 
daemon, but do they all point to the Physical Hostname, or the Virtual 
Host Name?

It appears that the index.cgi is attempting to set agentnum, is this 
where is occurs? 

$agentnum = '';

if ( -e $signup_html ) {

  my $signup_txt = Text::Template::_load_text($signup_html)

    or die $Text::Template::ERROR;

  $signup_txt =~ /^(.*)$/s; #untaint the template source - it's trusted

  $signup_txt = $1;

  $signup_template = new Text::Template ( TYPE => 'STRING',

                                          SOURCE => $signup_txt,

                                          DELIMITERS => [ '<%=', '%>' ]

                                        )

    or die $Text::Template::ERROR;

  if ( $signup_txt =~

         /<\s*INPUT 
TYPE="?hidden"?\s+NAME="?agentnum"?\s+VALUE="?(\d+)"?\s*>/si

  ) {

    $agentnum = $1;

  }

} else {

  #too much maintenance hassle to keep in this file

  die "can't find ./signup.html or /usr/local/freeside/signup.html";

  #$signup_template = new Text::Template ( TYPE => 'STRING',

  #                                        SOURCE => &signup_default,

  #                                        DELIMITERS => [ '<%=', '%>' ]

  #                                      )

  #  or die $Text::Template::ERROR;

}


I am not a Perl Guru, or this may already be apparent.  Can someone 
please brief me on this code fragment?  Is it looking for the line:

<*INPUT TYPE="hidden" NAME="agentnum" VALUE="a number"> in the file?  
Would this be a Good place (inside the signup.html file) to set the 
agentnum value?  Looks like a good place to me.

But then my question becomes how to connect to the agentnum?

My installation does not follow the documentation for for the 
freeside-selfservice-server.  My installation starts the daemons with:

          echo -n "Starting freeside-selfservice-server to $MACHINE: "
          freeside-selfservice-server $SELFSERVICE_USER $MACHINE

SO does this listen to all Agentnum and refnum requests?

Whew, that's enough for now.



-- 
Albert E. Whale, CHS CISA CISSP
Sr. Security, Network, Risk Assessment and Systems Consultant
-------------------------------------------------------------------
ABS Computer Technology, Inc. - www.ABS-CompTech.com
SPAM Zapper - No-JunkMail.com - Spam-Zapper.com - SPAM Stops Here.
President of the Pittsburgh InfraGard Alliance




More information about the freeside-users mailing list