Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 26th August 2010, 16:27
bruno_floyd bruno_floyd is offline
Member
 
Join Date: Aug 2010
Posts: 73
Thanks: 1
Thanked 2 Times in 2 Posts
Default Problems on creating new module

Hi guys,

I'm trying to creat a new module following the instructions based on this tutorial:
http://docs.ispconfig.org/development/interface/

I created the DB Table of the new module on my own at the main account accoding to the model used on the other tables... and did all the steps, changing what is concerned to my new module instead of "help".

I'm able to select the new module for the admin, but when I login again and click on the link of the it, I got the following error on a alertbox:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../themes/default/css/central.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="uniForm">
<div id="errorMsg">
<h3>Error</h3>
<ol>
<li>301</li>
</ol>
</div>
</div>
</body>
</html>


Does anybody knows what's going on?
Thanks guys!
Reply With Quote
Sponsored Links
  #2  
Old 26th August 2010, 16:36
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,788
Thanks: 840
Thanked 5,612 Times in 4,423 Posts
Default

Which ISPConfig version do you use?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 26th August 2010, 16:50
bruno_floyd bruno_floyd is offline
Member
 
Join Date: Aug 2010
Posts: 73
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Last release... 3.0.2.2

I installed on a computer for testing. I creat a new table at the DB and uploading the files I created to the ISPConfig directory and testing...
Reply With Quote
  #4  
Old 31st August 2010, 17:46
bruno_floyd bruno_floyd is offline
Member
 
Join Date: Aug 2010
Posts: 73
Thanks: 1
Thanked 2 Times in 2 Posts
Default

I had success on creating my new module and so on...

Now I'm trying to setup the admin and user permissions. How can I set a button, for exemple the "delete entry" button to only appear when the logged account is from the Admin?

Thks guys!
Reply With Quote
  #5  
Old 31st August 2010, 20:14
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,788
Thanks: 840
Thanked 5,612 Times in 4,423 Posts
Default

This should work in all templates:

Code:
<tmpl_if name="is_admin">
.... your html code here ....
</tmpl_if>
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 2nd September 2010, 15:41
bruno_floyd bruno_floyd is offline
Member
 
Join Date: Aug 2010
Posts: 73
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Thanks till!

It worked!

I have another question if you allow me...

I'm trying to get a valeu from the DB, doing this:

$sql = $app->db->query("SELECT groupid FROM sys_group WHERE client_id = ".$this->dataRecord['indicou_id']);

$group = $app->db->queryOneRecord($sql);

And then update "sys_groupid" from my table "indicacao":

$app->db->query("UPDATE indicacao SET sys_groupid = ".$group." WHERE indicacao_id = ".$this->id);

These lines are in the function onAfterInsert()... and when I execute another stuff from my code in that section they are executed, but not the update above. Could you help?

Thanks again!

Last edited by bruno_floyd; 2nd September 2010 at 15:47.
Reply With Quote
  #7  
Old 9th September 2010, 01:30
bruno_floyd bruno_floyd is offline
Member
 
Join Date: Aug 2010
Posts: 73
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Can you help me till?

sorry about disturbing ya!
=)
Reply With Quote
  #8  
Old 9th September 2010, 11:35
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,788
Thanks: 840
Thanked 5,612 Times in 4,423 Posts
Default

The code to get the group has to look like this:

$group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$this->dataRecord['indicou_id']);
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 14th September 2010, 17:02
bruno_floyd bruno_floyd is offline
Member
 
Join Date: Aug 2010
Posts: 73
Thanks: 1
Thanked 2 Times in 2 Posts
Default

I could not store the value from the DB to my $group variable...

Is this the right way to get a value from the Db and put into the variable?

Thanks again till!
Reply With Quote
  #10  
Old 15th September 2010, 16:34
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,788
Thanks: 840
Thanked 5,612 Times in 4,423 Posts
 
Default

$group is a hash array, it is not a single value.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeradius and Mysql uvstudios HOWTO-Related Questions 4 19th February 2014 13:11
Proftpd + MySQL virtual users, can't connect geekman HOWTO-Related Questions 28 27th September 2010 19:03
FreeRadius + MySQL working, but I don't know how to customise SQL queries awe Installation/Configuration 4 5th April 2010 00:28
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 18:26
Webmin docs missing namit Server Operation 11 5th January 2006 10:51


All times are GMT +2. The time now is 21:20.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.