private function updatePhoto()
 {
     if (isset($this->facebookUser['picture']['data']['url'])) {
         $this->Users->clear();
         $this->Users->id = $this->user['User']['id'];
         $this->Users->set(array('User' => array('photo_small' => $this->facebookUser['picture']['data']['url'])));
         $this->Users->save($this->Users->data, false, array('photo_small'));
     }
 }
 public function setEnded($file_id)
 {
     $user_rec_id = Mysql::getInstance()->from('users_rec')->where(array('file_id' => $file_id))->get()->first('id');
     if (empty($user_rec_id)) {
         return false;
     }
     $stopped = $this->stop($user_rec_id, false);
     if ($stopped) {
         $user_record = Mysql::getInstance()->from('users_rec')->where(array('id' => $user_rec_id))->get()->first();
         $channel = Itv::getChannelById($user_record['ch_id']);
         $event = new SysEvent();
         $event->setUserListById($user_record['uid']);
         User::clear();
         $user = User::getInstance((int) $user_record['uid']);
         $event->sendMsg($user->getLocalizedText('Stopped recording') . ' — ' . $user_record['program'] . ' ' . $user->getLocalizedText('on channel') . ' ' . $channel['name']);
     }
     return $stopped;
 }
Example #3
0
\t\t\t\t\t\t<td align="left"><input class="inputgri" name="adminPassword" type="password"></td>
\t\t\t\t\t</tr>
\t\t\t\t</table>
\t\t\t\t<p><input class="button" value="Submit &raquo;" name="loginsubmit" type="submit"></p>
\t\t\t</form>
OUT;
        break;
        /*****************************************************************
         * LOG OUT
         ******************************************************************/
    /*****************************************************************
     * LOG OUT
     ******************************************************************/
    case 'logout':
        # Clear all user data
        $user->clear();
        # Print confirmation
        $confirm->add('You are now logged out.');
        # Redirect back to login page
        $location->redirect('login');
        break;
        /*****************************************************************
         * INDEX - check status and print summary
         ******************************************************************/
    /*****************************************************************
     * INDEX - check status and print summary
     ******************************************************************/
    case '':
        #
        # System requirements
        #
 public function delete(RESTRequest $request)
 {
     $identifiers = $request->getIdentifiers();
     if (!empty($identifiers[0]) && strlen($identifiers[0]) >= 12) {
         $users_ids = Stb::getUidByMacs($identifiers);
     } else {
         $users_ids = Stb::getUidByAccountNumber($identifiers);
     }
     if (count($identifiers) == 1 && count($users_ids) == 0) {
         throw new RESTCommandException('Account not found');
     }
     if (count($identifiers) > 1) {
         throw new RESTCommandException('Only one identifier allowed');
     }
     $result = true;
     foreach ($users_ids as $user_id) {
         $user = User::getInstance($user_id);
         $info = $user->getAccountInfo();
         $subscribe = $user->updateOptionalPackageSubscription(array('subscribe' => array(), 'unsubscribe' => $info['subscribed']));
         $result = $result && $subscribe;
         User::clear();
     }
     return $result;
 }
 public function delete(RESTRequest $request)
 {
     $identifiers = $request->getIdentifiers();
     if (count($identifiers) == 0) {
         throw new RESTCommandException('Identifier required');
     }
     $users_ids = $this->getUsersIdsFromIdentifiers($identifiers);
     if (count($identifiers) == 1 && count($users_ids) == 0) {
         throw new RESTCommandException('Account not found');
     }
     if (count($identifiers) > 1) {
         throw new RESTCommandException('Only one identifier allowed');
     }
     $result = true;
     foreach ($users_ids as $user_id) {
         $user = User::getInstance($user_id);
         $result = $user->delete() && $result;
         User::clear();
     }
     return $result;
 }