- Posts: 7848
Feature Requests
Please do NOT use this section of the forum to request help if Joomdle does not work for you in some particular way. Your post will be deleted.
Please do NOT use this section of the forum to request help if Joomdle does not work for you in some particular way. Your post will be deleted.
[Closed] User sync
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
16 years 1 month ago #21
by Antonio Durán
Replied by Antonio Durán on topic Re: User sync
Ok, as redmuze suggested, I finally setp up SVN at sourceforge, so you can start doing some work for yourselves.
As I said, you should get SF accounts so I can give you access to the repository.
I already created a new branch, called redmuze, based on R0.23. Maybe it would be better to start with the current 0.24 code, when I can tidy it up a little.
Halkon, if you want, I can create another branch so you two can work separately.
As for the requirements that the code needs to meet to be included in Joomdle, the main one is that nothing should require any code modification in Moodle or Joomla, be it core or extensions.
This is so we can keep Joomdle easy to install and maintain.
As I said, you should get SF accounts so I can give you access to the repository.
I already created a new branch, called redmuze, based on R0.23. Maybe it would be better to start with the current 0.24 code, when I can tidy it up a little.
Halkon, if you want, I can create another branch so you two can work separately.
As for the requirements that the code needs to meet to be included in Joomdle, the main one is that nothing should require any code modification in Moodle or Joomla, be it core or extensions.
This is so we can keep Joomdle easy to install and maintain.
The topic has been locked.
- Peter
- Offline
- New Member
-
Less
More
- Posts: 1
16 years 1 month ago #22
by Peter
Replied by Peter on topic Re:User sync
Trigger Event Table Statement Timing Created sql_mode Definer
update_user_after_insert INSERT jos_users BEGIN
DECLARE MY_USERNAME VARCHAR(255) ;
DECLARE MY_ID INT(11) ;
DECLARE MY_PASSWORD VARCHAR(255) ;
DECLARE MY_EMAIL VARCHAR(255) ;
SET MY_PASSWORD = '';
SET MY_EMAIL = '';
SET MY_USERNAME = '';
IF exists (SELECT * FROM jos_users, jos_comprofiler WHERE username = NEW.username AND jos_users.id = jos_comprofiler.id) THEN
SELECT id INTO MY_ID FROM jos_users WHERE username = NEW.username;
SELECT password INTO MY_PASSWORD FROM jos_users WHERE username = NEW.username;
IF MY_PASSWORD = '' THEN
SELECT password INTO MY_PASSWORD FROM jos_users WHERE username = NEW.username;
END IF;
IF MY_USERNAME = '' THEN
SELECT username INTO MY_USERNAME FROM jos_users WHERE username = NEW.username;
END IF;
IF MY_EMAIL = '' THEN
SELECT email INTO MY_EMAIL FROM jos_users WHERE username = NEW.username;
END IF;
UPDATE jos_comprofiler set cb_hiddenpassword = MY_PASSWORD WHERE id = MY_ID;
UPDATE jos_comprofiler set cb_hiddenuser = MY_USERNAME WHERE id = MY_ID;
UPDATE jos_comprofiler set cb_hiddenemail = MY_EMAIL WHERE id = MY_ID;
END IF;
END AFTER NULL
root@localhost
update_user UPDATE jos_users BEGIN
DECLARE MY_USERNAME VARCHAR(255) ;
DECLARE MY_ID INT(11) ;
DECLARE MY_PASSWORD VARCHAR(255) ;
DECLARE MY_EMAIL VARCHAR(255) ;
SET MY_PASSWORD = '';
SET MY_EMAIL = '';
SET MY_USERNAME = '';
IF exists (SELECT * FROM jos_users, jos_comprofiler WHERE username = NEW.username AND jos_users.id = jos_comprofiler.id) THEN
SELECT id INTO MY_ID FROM jos_users WHERE username = NEW.username;
SELECT password INTO MY_PASSWORD FROM jos_users WHERE username = NEW.username;
IF MY_PASSWORD = '' THEN
SELECT password INTO MY_PASSWORD FROM jos_users WHERE username = NEW.username;
END IF;
IF MY_USERNAME = '' THEN
SELECT username INTO MY_USERNAME FROM jos_users WHERE username = NEW.username;
END IF;
IF MY_EMAIL = '' THEN
SELECT email INTO MY_EMAIL FROM jos_users WHERE username = NEW.username;
END IF;
UPDATE jos_comprofiler set cb_hiddenpassword = MY_PASSWORD WHERE id = MY_ID;
UPDATE jos_comprofiler set cb_hiddenuser = MY_USERNAME WHERE id = MY_ID;
UPDATE jos_comprofiler set cb_hiddenemail = MY_EMAIL WHERE id = MY_ID;
END IF;
END AFTER NULL
root@localhost
you will need to create the following joomla CB fields. cb_hiddenemail, cb_hiddenuser, cb_hiddenpassword, cb_discount change the address info to what you want. you will need mysql 5.0.2 or better for this to work.
I set this up but can I use the same user info sent to moodle using the database connection is it possible using this kind of set up for joomdle and and I use the existing user info from moodle to be used by joomdle?
update_user_after_insert INSERT jos_users BEGIN
DECLARE MY_USERNAME VARCHAR(255) ;
DECLARE MY_ID INT(11) ;
DECLARE MY_PASSWORD VARCHAR(255) ;
DECLARE MY_EMAIL VARCHAR(255) ;
SET MY_PASSWORD = '';
SET MY_EMAIL = '';
SET MY_USERNAME = '';
IF exists (SELECT * FROM jos_users, jos_comprofiler WHERE username = NEW.username AND jos_users.id = jos_comprofiler.id) THEN
SELECT id INTO MY_ID FROM jos_users WHERE username = NEW.username;
SELECT password INTO MY_PASSWORD FROM jos_users WHERE username = NEW.username;
IF MY_PASSWORD = '' THEN
SELECT password INTO MY_PASSWORD FROM jos_users WHERE username = NEW.username;
END IF;
IF MY_USERNAME = '' THEN
SELECT username INTO MY_USERNAME FROM jos_users WHERE username = NEW.username;
END IF;
IF MY_EMAIL = '' THEN
SELECT email INTO MY_EMAIL FROM jos_users WHERE username = NEW.username;
END IF;
UPDATE jos_comprofiler set cb_hiddenpassword = MY_PASSWORD WHERE id = MY_ID;
UPDATE jos_comprofiler set cb_hiddenuser = MY_USERNAME WHERE id = MY_ID;
UPDATE jos_comprofiler set cb_hiddenemail = MY_EMAIL WHERE id = MY_ID;
END IF;
END AFTER NULL
root@localhost
update_user UPDATE jos_users BEGIN
DECLARE MY_USERNAME VARCHAR(255) ;
DECLARE MY_ID INT(11) ;
DECLARE MY_PASSWORD VARCHAR(255) ;
DECLARE MY_EMAIL VARCHAR(255) ;
SET MY_PASSWORD = '';
SET MY_EMAIL = '';
SET MY_USERNAME = '';
IF exists (SELECT * FROM jos_users, jos_comprofiler WHERE username = NEW.username AND jos_users.id = jos_comprofiler.id) THEN
SELECT id INTO MY_ID FROM jos_users WHERE username = NEW.username;
SELECT password INTO MY_PASSWORD FROM jos_users WHERE username = NEW.username;
IF MY_PASSWORD = '' THEN
SELECT password INTO MY_PASSWORD FROM jos_users WHERE username = NEW.username;
END IF;
IF MY_USERNAME = '' THEN
SELECT username INTO MY_USERNAME FROM jos_users WHERE username = NEW.username;
END IF;
IF MY_EMAIL = '' THEN
SELECT email INTO MY_EMAIL FROM jos_users WHERE username = NEW.username;
END IF;
UPDATE jos_comprofiler set cb_hiddenpassword = MY_PASSWORD WHERE id = MY_ID;
UPDATE jos_comprofiler set cb_hiddenuser = MY_USERNAME WHERE id = MY_ID;
UPDATE jos_comprofiler set cb_hiddenemail = MY_EMAIL WHERE id = MY_ID;
END IF;
END AFTER NULL
root@localhost
you will need to create the following joomla CB fields. cb_hiddenemail, cb_hiddenuser, cb_hiddenpassword, cb_discount change the address info to what you want. you will need mysql 5.0.2 or better for this to work.
I set this up but can I use the same user info sent to moodle using the database connection is it possible using this kind of set up for joomdle and and I use the existing user info from moodle to be used by joomdle?
The topic has been locked.
- red
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 38
16 years 1 month ago #23
by red
Replied by red on topic Re:User sync
ill check this out on monday... im kind of overloaded until then
The topic has been locked.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7848
15 years 7 months ago #24
by Antonio Durán
Replied by Antonio Durán on topic Re:User sync
Features added in R0.4 to sync profile info from Moodle to Joomla.
The topic has been locked.