#1  
Old 6th August 2007, 03:04
Tommahawk Tommahawk is offline
Member
 
Join Date: May 2007
Posts: 70
Thanks: 0
Thanked 10 Times in 5 Posts
Default Remoting sys user

Remoting framework is adding clients OK in isp_isp_kunde but it does not seem to be adding a sys_user. The code shows that it is the sys_user table that is queried when logging in. How can I have remoting add an entry in the sys_user table, is it a matter of adding an SQL command in a particular file or is their something I have missed?

I believe that
/home/admispconfig/ispconfig/lib/classes/ispconfig_kunde.lib.php
function kunde_add($session,$params) {
is what is called when adding a new client and their is no reference to sys_user there
the only other place sys_user is referenced relative to my issue is in the
/home/admispconfig/ispconfig/lib/classes/ispconfig_isp_kunde.lib.php file
function kunde_insert($doc_id, $doctype_id, $die_on_error = '1') {

Thanks in advance.

Last edited by Tommahawk; 6th August 2007 at 04:14.
Reply With Quote
Sponsored Links
  #2  
Old 6th August 2007, 04:51
Tommahawk Tommahawk is offline
Member
 
Join Date: May 2007
Posts: 70
Thanks: 0
Thanked 10 Times in 5 Posts
Default

I fixed the issue so when a new client is added they can immediately login by adding this to file ispconfig_kunde.lib.php after aprox line 290


//add a relative sys_user
$userid = $go_info["user"]["userid"];

$sql = "INSERT INTO sys_user (
userid,
username,
passwort,
gueltig,
perms,
modules,
modul
) VALUES (
'$userid',
'".addslashes($params["webadmin_user"])."',
'$passfmt1',
'1',
'rw',
'isp_kunde,isp_file,tools,help',
'isp_kunde'
)";

$go_api->db->query($sql);
$userid = $go_api->db->insertID();

$sql = "INSERT INTO sys_nodes (
userid,
groupid,
parent,
type,
doctype_id,
status,
doc_id,
title
) VALUES (
'1',
'0',
'',
'a',
'1',
'1',
'$userid',
''
)";

$go_api->db->query($sql);


I also added the following to same file when a new client is added

$passfmt1 = md5($params["webadmin_passwort"]);
$passfmt2 = "||||:".$passfmt1;


I also noticed that the sys_user is not deleted at all.... hope it helps

Last edited by Tommahawk; 6th August 2007 at 05:03.
Reply With Quote
  #3  
Old 6th August 2007, 09:01
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,451
Thanks: 813
Thanked 5,219 Times in 4,090 Posts
Default

The File /home/admispconfig/ispconfig/lib/classes/ispconfig_isp_kunde.lib.php is called by the file /home/admispconfig/ispconfig/lib/classes/ispconfig_isp_kunde.lib.php and this worked some time ago. I added it to the bugtracker, maybe we changed something that made it incompatible with the remoting framework.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 6th August 2007, 13:27
Tommahawk Tommahawk is offline
Member
 
Join Date: May 2007
Posts: 70
Thanks: 0
Thanked 10 Times in 5 Posts
Default

It then becomes impossible to assign a website to the client because the client is not sufficiently registered something to do with webadmin_userid variable (in isp_isp_kunde mysql table) being installed with a default value of 0, I am in the dark about where this number should come from or how I can generate it validly, any ideas Thanks in advance

It seems when this number is unique the problem gets solved and sites can be allocated to the client, I will do some further tests...Now that leaves ISPConfig to cleanup the following mysql tables

isp_isp_kunde
isp_nodes
sys_user
sys_nodes
and what exists already such as websites associated when a client gets deleted

Thanks my issues are almost solved and I will post the remoting php script that adds users and sites while you sleep soon.

Last edited by Tommahawk; 6th August 2007 at 13:38.
Reply With Quote
  #5  
Old 15th August 2007, 05:21
Tommahawk Tommahawk is offline
Member
 
Join Date: May 2007
Posts: 70
Thanks: 0
Thanked 10 Times in 5 Posts
Default

AFAIK

Remoting code in file: /home/admispconfig/ispconfig/lib/classes/ispconfig_kunde.lib.php

in current stable Version: 2.2.15 is missing

1) sys_user creation procedure in sys_user table
2) webadmin_userid generation procedure in isp_isp_kunde table where is webadmin_userid in the isp_isp_kunde table is the doc_id of the sys_user table for that same client

The code fix resides in /home/admispconfig/ispconfig/lib/classes/ispconfig_isp_kunde.lib.php from line 86 to 106 copy and paste that after the kunde is created but looking for an official fix because their are some issues with syncing webadmin_userid <-> doc_id

1) Is the code missing in previous versions?
2) What is the fix?

Last edited by Tommahawk; 15th August 2007 at 05:46.
Reply With Quote
  #6  
Old 15th August 2007, 07:38
Tommahawk Tommahawk is offline
Member
 
Join Date: May 2007
Posts: 70
Thanks: 0
Thanked 10 Times in 5 Posts
Default

Done fixed I will post my version of the lib file but someone who knows what is happening needs to look over it.

I also have a paypal integrated script that adds 1 client, 1 user, 1 website via webpage. If ISPConfig want to make it available as a commercial addon let me know otherwise I will post it here...
Reply With Quote
  #7  
Old 15th August 2007, 09:27
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,451
Thanks: 813
Thanked 5,219 Times in 4,090 Posts
 
Default

Quote:
Originally Posted by Tommahawk
AFAIK

Remoting code in file: /home/admispconfig/ispconfig/lib/classes/ispconfig_kunde.lib.php

in current stable Version: 2.2.15 is missing

1) sys_user creation procedure in sys_user table
2) webadmin_userid generation procedure in isp_isp_kunde table where is webadmin_userid in the isp_isp_kunde table is the doc_id of the sys_user table for that same client

The code fix resides in /home/admispconfig/ispconfig/lib/classes/ispconfig_isp_kunde.lib.php from line 86 to 106 copy and paste that after the kunde is created but looking for an official fix because their are some issues with syncing webadmin_userid <-> doc_id

1) Is the code missing in previous versions?
2) What is the fix?
Afaik, you are wrong. There is nothing missing. You totally mix up different parts of the framework. There are no dupliacte functions as you posted in the feature requests thread.

The sys_user is inserted automatically when you update the kunde record and provide the username and password. That is needed because the interface provides the username and password for the client on another tab and though it is checked and inserted in the update event and not on the insert event.

What you are doing is duplicationg code and it is not a good idea to copy code around instead of reusing it by including the code as the current framework does it.
__________________
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
Statistic not working mzo Installation/Configuration 49 20th April 2011 12:19
Anything I can do against illegal login-requests? schmidtedv Installation/Configuration 17 7th November 2008 09:25
Remoting in 2.3.2 does not create user in sys_user table NTAuthority General 0 28th June 2007 20:48
Can't get fail2ban to work. boast Server Operation 2 26th June 2007 00:55
log files cruz Technical 3 15th May 2007 14:35


All times are GMT +2. The time now is 14:17.


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