Skip to Content Skip to Menu

New users not assigned to k2 group

  • tonisko
  • tonisko
  • OFFLINE
  • Posts: 10
  • Thanks: 2
  • Karma: 0
12 years 1 month ago #208638 by tonisko
Replied by tonisko on topic Re: New users not assigned to k2 group
hello

this is not a very professional solution, but it works for me :) ... i have done it some time ago, but it works also for the newest version of joomla, k2 and CB

maybe someone can inprove it to some plugin or something...


file: components/com_comprofiler/comprofiler.php

around line 957 begins the function "function saveRegistration( $option )", at the end of this function, before the "}" sign insert this code (it must be a part of the function) ...
Code:
$jconfig = new JConfig(); $db_error = "Mysql error!"; $db_config = mysql_connect( $jconfig->host, $jconfig->user, $jconfig->password ) or die( $db_error ); mysql_select_db( $jconfig->db, $db_config ) or die( $db_error ); // Get Joomla DB prefix // $config =& JFactory::getConfig(); $table_prefix = $config->getValue( 'dbprefix' ); // get user groupid from plugin settings // $k2_default_usergroup_id = "1"; // !!! Set your number of default group !!! // // Insert record into K2 user table $k2_query = 'SELECT id '. 'FROM ' . $table_prefix . 'users '. 'ORDER BY id DESC '. 'LIMIT 1'; $id_cko = mysql_query($k2_query); $id_cko2 = mysql_fetch_array($id_cko); $k2_query2 = 'SELECT name '. 'FROM ' . $table_prefix . 'users '. 'ORDER BY id DESC '. 'LIMIT 1'; $name_to_k2 = mysql_query($k2_query2); $name_to_k2_2 = mysql_fetch_array($name_to_k2); $sql = 'INSERT INTO ' . $table_prefix . 'k2_users SET `userID` = "' . $id_cko2[0] . '", `userName` = "' . $name_to_k2_2[0] . '", `group` = "' . $k2_default_usergroup_id . '" '; mysql_query($sql);
The following user(s) said Thank You: ladispute

Please Log in or Create an account to join the conversation.

  • geet123
  • geet123
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
11 years 6 months ago #225647 by geet123
Replied by geet123 on topic Re: New users not assigned to k2 group
not working in my case..

Please Log in or Create an account to join the conversation.

  • wweb
  • wweb
  • OFFLINE
  • Posts: 12
  • Thanks: 1
  • Karma: 0
10 years 6 months ago #243675 by wweb
Replied by wweb on topic New users not assigned to k2 group
Any update to this issue? I am having the same problem.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum