+ if ($data['video'] === FALSE)
+ {
+ $this->load->helper('message');
+ show_error_msg_page($this,
+ $this->lang->line('video_msg_no_video'));
+ return;
+ }
+
+ // Video is being processed by CIS.
+ if ($data['video']['activation_code']
+ && !$data['video']['content_ingested'])
+ {
+ $this->load->helper('message');
+ show_error_msg_page($this,
+ $this->lang->line('video_msg_video_not_ready'));
+ return;
+ }
+
+ // Unlogged in user can't see unactivated videos.
+ if (empty($data['user_id']))
+ $allow_unactivated = FALSE;
+ else
+ {
+ if (($user_roles & USER_ROLE_ADMIN) == 0
+ && $data['user_id'] != $data['video']['user_id'])
+ $allow_unactivated = FALSE;
+ else
+ $allow_unactivated = TRUE;
+ }
+
+ // Video is not activated; can be seen by owner and admin.
+ if ($data['video']['activation_code'] && !$allow_unactivated)
+ {
+ $this->load->helper('message');
+ show_error_msg_page($this,
+ $this->lang->line('video_msg_video_unactivated'));
+ return;
+ }
+