|
| 1 | +--- |
| 2 | +title: "Survey Tool Administrator's Page" |
| 3 | +--- |
| 4 | + |
| 5 | +## CLA |
| 6 | + |
| 7 | +Note: A SurveyTool restart will be required to flush the CLA settings cache. |
| 8 | + |
| 9 | +### Updating the Organization status of a single user |
| 10 | + |
| 11 | +The following SQL will update a single user (id 12) with a specific organization |
| 12 | + |
| 13 | +```sql |
| 14 | +-- get ready to update |
| 15 | +-- find the set kind for SignedCla |
| 16 | +set @SET_CLA = (select set_id from set_kinds where set_name = 'SignedCla'); |
| 17 | +set @UPDATE_ORG = 'airbnb'; set @SIGNED_DATE='2023-08-28'; set @CLDR_VER='48'; |
| 18 | +SET @UPDATE_USER = 12; |
| 19 | +SELECT @SET_CLA,@UPDATE_ORG,@SIGNED_DATE,@CLDR_VER,@UPDATEUSER; -- verify vars |
| 20 | +-- Update ONE USER |
| 21 | +REPLACE INTO set_values (usr_id, set_id, set_value) |
| 22 | + values (@UPDATE_USER, @SET_CLA, |
| 23 | + CONCAT('{"email":"-","name":"-","employer":"', |
| 24 | + @UPDATE_ORG, |
| 25 | + '","corporate":"true","version":"', |
| 26 | + @CLDR_VER, |
| 27 | + '","signed":"', |
| 28 | + @SIGNED_DATE, |
| 29 | + '","readonly":"true"}') |
| 30 | + ); |
| 31 | +-- update ALL USERS |
| 32 | +select id from CLDR_USERS where org = @UPDATE_ORG; |
| 33 | +-- now, double check (dumps the entire table) |
| 34 | +select usr_id, set_id, set_value, CONVERT(set_value USING utf8) as j from set_values where set_id = @SET_CLA and usr_id = @UPDATE_USER; |
| 35 | +``` |
| 36 | + |
| 37 | +### Updating the Organization status of an entire organization |
| 38 | + |
| 39 | +If the in-Java org list isn't updated properly, you can use the script `cla-org-sql-update.sql` (in the repo) to add a stored procedure. (Load and execute the .sql first, it's not loaded by default.) |
| 40 | + |
| 41 | +```sql |
| 42 | +CALL update_org_cla('airbnb','48','2023-08-28'); |
| 43 | +``` |
| 44 | + |
| 45 | +This will update every user in the organization's CLA status. |
0 commit comments