1 | <?php |
---|
2 | |
---|
3 | define('ROOTPATH', dirname(__FILE__).'/prototype'); |
---|
4 | require_once ROOTPATH.'/api/controller.php'; |
---|
5 | |
---|
6 | $calendars = Controller::find( array('concept' => 'calendar') , false ); |
---|
7 | |
---|
8 | foreach ($calendars as $key => $calendar) |
---|
9 | { |
---|
10 | $signatureOwner = Controller::find(array('concept' => 'calendarSignature') , false , array('filter' => array('and', array( '=' , 'calendar' , $calendar['id'] ), array( '=' , 'isOwner' , '1' )))); |
---|
11 | $user = Controller::read(array('concept' => 'user' , 'id' => $signatureOwner[0]['user']) ); |
---|
12 | |
---|
13 | $locationArray = explode('/', $calendar['location']); |
---|
14 | |
---|
15 | if($locationArray[0] !== $user['uid']) |
---|
16 | Controller::update(array('concept' => 'calendar' , 'id' => $calendar['id']) , array( 'location' => $user['uid'].'/'.$calendar['location'] )); |
---|
17 | |
---|
18 | } |
---|
19 | |
---|
20 | ?> |
---|