예제 #1
0
 public function checkProfile($id)
 {
     $profile = $this->getInfo((int) $id);
     $photoCount = connectionUserPhotoModel::create()->countPhoto((int) $id);
     $fields = connectionFieldsModel::create()->where(array('important' => true))->fetchAll();
     $result = array();
     if ($photoCount == 0) {
         $result[] = '<a href="/profile/photo/">[`Title profile download your photo`]</a>';
     }
     if (!isset($profile['email_confirmation'])) {
         $result[] = '[`Title profile please confirm your email`]: <span>' . $profile['email'] . '</span>';
     }
     if (empty($profile['first_name'])) {
         $result[] = '[`Title profile please fill field`]: <span>[`Title field first name`]</span>';
     }
     if (empty($profile['last_name'])) {
         $result[] = '[`Title profile please fill field`]: <span>[`Title field last name`]</span>';
     }
     foreach ($fields as $field) {
         if (!isset($profile['field_' . $field['id']]) || empty($profile['field_' . $field['id']])) {
             $locale = connectionFieldsModel::create()->getFieldLocale($field['id'], Language::getActiveLanguageISO());
             $result[] = '[`Title profile please fill field`]: <span>' . $locale['title'] . '</span>';
         }
     }
     return sizeof($result) == 0 ? true : $result;
 }
 function execute()
 {
     $user = connectionUserModel::create()->getInfo((int) Request::params('user_id'));
     if (!$user || !isset($user['avatar'])) {
         $this->notFound();
     }
     $file = connectionUserPhotoModel::create()->getImageSize((int) $user['avatar']['id'], (int) Request::params('user_id'), (int) Request::params('photo_size'));
     $this->showFile($file);
 }
 public function execute()
 {
     $id = (int) Request::post('id');
     connectionUserPhotoModel::create()->where(array('id' => $id))->delete();
 }
 function execute()
 {
     connectionUserPhotoModel::create()->where(array('id' => (int) Request::post('id')))->update(array('published' => true));
 }