Created
March 25, 2012 06:45
-
-
Save mikevalstar/2191917 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function project_add_user($var, $run = true){ | |
| $expected = array('project_id' => '', 'id' => ''); | |
| if(!cBasecamp::_checkVarTemplate($expected, $var, "project_del_user")) | |
| return false; | |
| if(!$run){ | |
| cBasecamp::_schedule("project_add_user", "Add user to group", $var); | |
| return true; | |
| }elseif($run === true){ | |
| // store then run with new taskid | |
| cBasecamp::project_add_user($var, cBasecamp::_schedule("project_add_user", "Add user to group", $var)); | |
| }else{ | |
| $project_url = "https://" . BasecampSiteURL . '/projects/'.$var['project_id'].'-group-title/participants'; | |
| $page1 = cBasecamp::_snoopy_loadPage($project_url); | |
| $post = $page1['form_input']; | |
| $post['firm_employees_with_access'][] = $var['id']; | |
| //print_r($post); | |
| $project_user_update_url = "https://" . BasecampSiteURL . '/projects/'.$var['project_id'].'-group-title/participants/update_all'; | |
| $page2 = cBasecamp::_snoopy_loadPage($project_user_update_url, $project_url, $post); | |
| // Mark | |
| cBasecamp::_markprocessed($run); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment