Changes

Jump to navigation Jump to search
added the original link where the howto was for references
Line 1: Line 1:  
{{Level|Developer}}
 
{{Level|Developer}}
   −
{{warning box|msg= This documentation on how to build a panel in the server-manager is completely deprecated but it can bring to the developers some tricks to understand what is occurring in an old contrib. Please if you intend to build a panel you should use formagick instead of the perl cgi}}
+
{{warning box|msg= '''This documentation on how to build a panel in the server-manager is completely deprecated''' but it can bring to the developers some tricks to understand what is occurring in old contribs. Please if you intend to build a panel you should use formagick instead of the perl cgi}}
[http://www.sme-server.de/download/Howtos/e-smith_panel_howto.html original Author]
+
[http://dungog.net/wiki/Main_Page original Author] <br />
 +
 
 +
[http://www.sme-server.de/download/Howtos/e-smith_panel_howto.html original link]
 
===Introduction===
 
===Introduction===
 
Writing a panel for an e-smith server need not be difficult. By choosing an existing panel that is similar to what you need you can get a head start. You need only a small background in any sort of programming, coding html or similar.
 
Writing a panel for an e-smith server need not be difficult. By choosing an existing panel that is similar to what you need you can get a head start. You need only a small background in any sort of programming, coding html or similar.
Line 696: Line 698:  
===Basic Perl===
 
===Basic Perl===
 
A few samples that demonstrate correct coding practise. In areas of logic, Testing user input, and calling events and unix programs.
 
A few samples that demonstrate correct coding practise. In areas of logic, Testing user input, and calling events and unix programs.
====Logic===
+
====Logic====
"||" gives an answer if the first try didn't work.
+
* "||" gives an answer if the first try didn't work.
    
       my $FetchmailFreqOffice = db_get_prop(\%conf, "fetchmail", "FreqOffice")
 
       my $FetchmailFreqOffice = db_get_prop(\%conf, "fetchmail", "FreqOffice")
Line 709: Line 711:  
     'standard';
 
     'standard';
   −
"if (defined $something)" if defined then first else second
+
* "if (defined $something)" if defined then first else second
    
     my $SecondaryMailUseEnvelope;
 
     my $SecondaryMailUseEnvelope;
Line 722: Line 724:  
     }
 
     }
   −
"&&" if true twice continue
+
* "&&" if true twice continue
    
     if (defined $backup_status && $backup_status eq "enabled")
 
     if (defined $backup_status && $backup_status eq "enabled")
Line 783: Line 785:  
If you have a lot of tests you can define a set of expressions, describe them, and test for them
 
If you have a lot of tests you can define a set of expressions, describe them, and test for them
   −
#define expression to test
+
* define expression to test
 
my $REGEXPHostname = '([a-z0-9][a-z0-9-\.]*)';
 
my $REGEXPHostname = '([a-z0-9][a-z0-9-\.]*)';
 
my $REGEXPIPAddress = '(self|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})';
 
my $REGEXPIPAddress = '(self|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})';
Line 789: Line 791:       −
#advice to user
+
* advice to user
 
     esmith::cgi::genTextRow ($q, $q->p ( 'The IP address displayed
 
     esmith::cgi::genTextRow ($q, $q->p ( 'The IP address displayed
 
       is the IP address of the e-smith server. If this hostname
 
       is the IP address of the e-smith server. If this hostname
Line 796: Line 798:  
       address in the format "aaa.bbb.ccc.ddd"' )),
 
       address in the format "aaa.bbb.ccc.ddd"' )),
   −
#get input
+
* get input
 
     esmith::cgi::genNameValueRow ($q,
 
     esmith::cgi::genNameValueRow ($q,
 
                       "Hostname",
 
                       "Hostname",
 
                       "HostName",
 
                       "HostName",
 
                       ""),
 
                       ""),
#test input
+
* test input
 
     my $MACAddress = lc($q->param ('MACAddress'));
 
     my $MACAddress = lc($q->param ('MACAddress'));
   Line 844: Line 846:  
===References===
 
===References===
 
====Bugs====
 
====Bugs====
Syntax errors are common, a misplaced , or missed ) will result in a panel that will not run or compile.
+
Syntax errors are common, a misplaced , or missed ) will result in a panel that will not run or compile. Look in /var/log/httpd/admin_error_log for errors or admin_access_log will report success.
Look in /var/log/httpd/admin_error_log for errors
+
 
or admin_access_log will report success.
+
Check that httpd-admin is running as well as httpd, via a  
Check that httpd-admin is running as well as httpd, via a ps -A |grep httpd.
+
ps -A |grep httpd.
    
Check you have correct permissions, and locate/link it the e-smith way
 
Check you have correct permissions, and locate/link it the e-smith way
cd /etc/e-smith/web/functions/
+
cd /etc/e-smith/web/functions/
chmod 750 thing, then chmod u+s thing (?sn)
+
chmod 750 thing, then chmod u+s thing (?sn)
cd /etc/e-smith/web/panel/manager/cgi-bin
+
cd /etc/e-smith/web/panel/manager/cgi-bin
ln -s ../../../thing thing
+
ln -s ../../../thing thing
Links
+
 
www.e-smth.org duh
+
====Links====
www.perl.org
+
www.e-smth.org duh
Thanks
+
www.perl.org
 +
 
 +
====Thanks====
 
A big thank you to Gordon, Charlie and the e-smith team.
 
A big thank you to Gordon, Charlie and the e-smith team.
   −
Stephen Noble April 2001 ver 0.1-2
+
Stephen Noble April 2001 ver 0.1-2

Navigation menu