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

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 16th August 2005, 21:09
Tribal-Dolphin Tribal-Dolphin is offline
Member
 
Join Date: Jul 2005
Location: Rives - Isčre - FRANCE
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default Support System

Hi all,
I'm working on support system and I have some question.

Why the sys_user table don't have the user email address ? (in my ISPConfig install, it's always @ispconfig.de)

The field 'userid' (on sys_user table) of a resseller contains the 'doc_id' of the admin and for a client, it contains the resseller creator's doc_id (or the admin doc_id). I'm right ?

Can I modify the go_info.inc.php file to add the 'userid' field of sys_user table ?

Thanks.
Tribal-Dolphin
Reply With Quote
Sponsored Links
  #2  
Old 16th August 2005, 23:14
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,381
Thanks: 833
Thanked 5,482 Times in 4,316 Posts
Default

Quote:
Originally Posted by Tribal-Dolphin
Why the sys_user table don't have the user email address ? (in my ISPConfig install, it's always @ispconfig.de)
Thats a good question The Field was there from another application that used the same framework. It is a good idea to use it in ISPConfig too, so we have to modify the isp_isp_kunde.inc.php and the isp_isp_reseller.inc.php to write the correct email address when creating a new controlpanel user.

Quote:
Originally Posted by Tribal-Dolphin
The field 'userid' (on sys_user table) of a resseller contains the 'doc_id' of the admin and for a client, it contains the resseller creator's doc_id (or the admin doc_id). I'm right ?
Yes, thats right.

The external relations are:

ID Relations Resellers:

sys_user.doc_id => isp_isp_reseller.reseller_userid

ID Relations Clients:

sys_user.doc_id => isp_isp_kunde.webadmin_userid



Quote:
Originally Posted by Tribal-Dolphin
Can I modify the go_info.inc.php file to add the 'userid' field of sys_user table ?
Yes, but i think in most cases you need the doc_id of the user. This is needed to check the permissions against the *_nodes tables. The doc_id of the user is alredy part of the $go_info array.
Reply With Quote
  #3  
Old 17th August 2005, 07:33
Tribal-Dolphin Tribal-Dolphin is offline
Member
 
Join Date: Jul 2005
Location: Rives - Isčre - FRANCE
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by till
It is a good idea to use it in ISPConfig too, so we have to modify the isp_isp_kunde.inc.php and the isp_isp_reseller.inc.php to write the correct email address when creating a new controlpanel user.
Ok, i'll go to modify this files.

Quote:
Originally Posted by till
Yes, but i think in most cases you need the doc_id of the user. This is needed to check the permissions against the *_nodes tables. The doc_id of the user is alredy part of the $go_info array.
I need the creator's ID for sent the support question to him. I've take a look to the *_nodes tables and i don't find how to retrieve the creator's ID.
Can you help me for that ?
Reply With Quote
  #4  
Old 17th August 2005, 11:27
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,381
Thanks: 833
Thanked 5,482 Times in 4,316 Posts
Default

Quote:
Originally Posted by Tribal-Dolphin
I need the creator's ID for sent the support question to him. I've take a look to the *_nodes tables and i don't find how to retrieve the creator's ID.
Can you help me for that ?
Who do you mean with creator? The client that sends a support question to the admin / reseller?

General explanation: If a user saves a form that was build with the form generator, the contents of the form are stored in the form specific table, the user and permission information is stored in the *_nodes table.

Example for isp_nodes and isp_isp_web:

isp_nodes.tree_id = unique index field of the nodes table.
isp_nodes.userid => sys_user.doc_id // Sorry, i know that this is a bit misleading with the userid column in sys_user, but doc_id is always the name of the primary index field of an table.
isp_nodes.groupid => groups.groupid
isp_nodes.parent => this field is for building the tree view, it can contain the tree ID of the parent item (folder) or the string group[GROUPID] when it is not in a folder and belongs to a group with the ID [GROUPID].
isp_nodes.type => contains 'n' if it is a folder, or 'i' if it is form document.
isp_nodes.doctype_id => isp_isp_web.doctype_id => doctype.doctype_id // in the doctype table are the form definitions stored that are made with the foem designer
isp_nodes.doc_id => isp_isp_web.doc_id // The doc_id's are the primary index fields of the content tables
isp_nodes.status // 1 = active, 0 = Deleted / stored in the trash
isp_nodes.icon // may contain the name of the icon file, if it is empty, a default icon is used
isp_nodes.modul // not used in ISPConfig
isp_nodes.title // The title that is displayed in the tree view, if the form is from the type that is displayed in the tree.
Reply With Quote
  #5  
Old 17th August 2005, 11:38
Tribal-Dolphin Tribal-Dolphin is offline
Member
 
Join Date: Jul 2005
Location: Rives - Isčre - FRANCE
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

The Creator is the person who have created the reseller/client account.
I'll need to know if the question is for admin, Reseller1, Reseller2, ......

I don't find this file : isp_isp_kunde.inc.php and the isp_isp_reseller.inc.php. Where they are ?
Reply With Quote
  #6  
Old 17th August 2005, 11:49
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

Quote:
Originally Posted by Tribal-Dolphin
I don't find this file : isp_isp_kunde.inc.php and the isp_isp_reseller.inc.php. Where they are ?
Actually it's ispconfig_isp_kunde.lib.php and ispconfig_isp_reseller.lib.php. They are in /home/admispconfig/ispconfig/lib/classes.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 17th August 2005, 12:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,381
Thanks: 833
Thanked 5,482 Times in 4,316 Posts
Default

Quote:
Originally Posted by Tribal-Dolphin
The Creator is the person who have created the reseller/client account.
I'll need to know if the question is for admin, Reseller1, Reseller2, ......
I assume you have the sys_user.doc_id of the reseller/client and want to get the sys_user.doc_id of the creator. First we will find out if it is a reseller or a client. When it is a reseller, the support requests have to be send to the admin:

$groups = $go_api->groups->myGroups();
if(is_array($groups)) {
//This user is a reseller, because clients do not have a group!
} else {
// This must be a client, now get the sys_user.doc_id of the reseller
$reseller = $go_api->db->queryOneRecord("SELECT doc_id FROM sys_user WHERE userid = $client_sys_doc_id");
$reseller_sys_doc_id = $reseller["doc_id"];

}


Quote:
Originally Posted by Tribal-Dolphin
I don't find this file : isp_isp_kunde.inc.php and the isp_isp_reseller.inc.php. Where they are ?
Sorry, i posted the wrong filenames:

in /home/admispconfig/ispconfig/web/lib/classes/

ispconfig_isp_kunde.lib.php
ispconfig_isp_reseller.lib.php

Every class contains functions that are called when an event like insert update or delete happens for a form. The functions are:

*_insert($doc_id, $doctype_id, $die_on_error = '1')
*_update($doc_id, $doctype_id, $die_on_error = '1')
*_delete($doc_id, $doctype_id, $die_on_error = '1')
Reply With Quote
  #8  
Old 17th August 2005, 18:41
Tribal-Dolphin Tribal-Dolphin is offline
Member
 
Join Date: Jul 2005
Location: Rives - Isčre - FRANCE
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'll try to modify the two class (ispconfig_isp_kunde.lib.php & ispconfig_isp_reseller.lib.php) for insert into sys_user table the field name, vorname, email, domain, ..... but it don't works.

Can anyone can tell me where (the line) I can add my code.

Thanks a lot

Exemple of code I'll try to insert into ispconfig_isp_kunde.lib.php at the line 105 (insert new client) :
Code:
$kunde = $go_api->db->queryOneRecord("SELECT * FROM isp_isp_kunde where webadmin_userid = '$userid'");
				
$vorname = $kunde["kunde_vorname"];
$name = $kunde["kunde_name"];
$strasse = $kunde["kunde_strasse"];
$plz = $kunde["kunde_plz"];
$ort = $kunde["kunde_ort"];
$telefon = $kunde["kunde_telefon"];
$fax = $kunde["kunde_fax"];
$kunde_email = explode("@", $kunde["kunde_email"]); $email=$kunde_email[0]; $domain=$kunde_email[1];
$land = $kunde["kunde_land"];
			
$sql = "UPDATE sys_user (vorname,name,strasse,plz,ort,telefon,fax,email,domain,land) VALUES ('$vorname','$name','$strasse','$plz','$ort','$telefon','$fax','$email','$domain','$land') WHERE doc_id = '$userid'";
$go_api->db->query($sql);
--------------------------------------------------------------
EDIT :

Otherwise, I have another idea.
Why do not to modify the file go_info.inc.php to get back the information unavailable in the table sys_user.
What do you think of it?

Last edited by Tribal-Dolphin; 17th August 2005 at 18:59.
Reply With Quote
  #9  
Old 17th August 2005, 21:08
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

You have an error here:

Quote:
$sql = "UPDATE sys_user (vorname,name,strasse,plz,ort,telefon,fax,email,do main,land) VALUES ('$vorname','$name','$strasse','$plz','$ort','$tel efon','$fax','$email','$domain','$land') WHERE doc_id = '$userid'";
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 17th August 2005, 22:47
Tribal-Dolphin Tribal-Dolphin is offline
Member
 
Join Date: Jul 2005
Location: Rives - Isčre - FRANCE
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

This error isn't in my file. it's an error of copy/paste.
Sorry
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
qmail, djbdns support needed papa Feature Requests 2 17th November 2005 13:31
Support System Tribal-Dolphin Feature Requests 3 20th August 2005 08:59
How to make it start automatically after system reset? KenMcGinnis Installation/Configuration 3 8th August 2005 12:25
MySQL support in PHP tobi Installation/Configuration 3 2nd May 2005 22:20
List of users on my system heat Technical 1 21st April 2005 12:00


All times are GMT +2. The time now is 01:33.


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