@Route("/{type}/{widgetId}", name="icap_portfolio_internal_widget_put", requirements={"widgetId" = "\d+"})
@Method({"PUT"})

@ParamConverter("loggedUser", options={"authenticatedUser" = true})
12895
public function putAction(Request $request, User $loggedUser, $type, $widgetId)
    {
        $this->checkPortfolioToolAccess($loggedUser);

        $widgetFindEvent = new WidgetFindEvent($widgetId, $type, $loggedUser);

        $this->get('event_dispatcher')->dispatch('icap_portfolio_widget_find_'.$type, $widgetFindEvent);

        $data = $this->getWidgetsManager()->handle($widgetFindEvent->getWidget(), $type, $request->request->all(), $this->get('kernel')->getEnvironment());

        $response = new JsonResponse();
        $response->setData($data);

        return $response;
    }
1284219
public function updateVisibilityAction(Request $request, User $loggedUser, Portfolio $portfolio)
    {
        $this->checkPortfolioToolAccess();

        try {
            if ($this->getPortfolioFormHandler()->handleVisibility($portfolio)) {
                if ($request->isXmlHttpRequest()) {
                    return new Response($this->refreshPortfolioList($loggedUser));
                } else {
                    $this->getSessionFlashbag()
                        ->add('success', $this->getTranslator()
                            ->trans('portfolio_visibility_update_success_message', [], 'icap_portfolio'));

                    return $this->redirect($this->generateUrl('icap_portfolio_index'));
                }
            }
        } catch (\Exception $exception) {
            if ($request->isXmlHttpRequest()) {
                return new JsonResponse('Error while updating visibility of the portfolio', 500);
            } else {
                $this->getSessionFlashbag()
                    ->add('error', $this->getTranslator()
                        ->trans('portfolio_visibility_update_error_message', [], 'icap_portfolio'));

                return $this->redirect($this->generateUrl('icap_portfolio_index'));
            }
        }

        return [
            'form' => $this->getPortfolioFormHandler()->getVisibilityForm($portfolio)->createView(),
            'portfolio' => $portfolio,
        ];
    }
374098
private void putId() {
        // note: name and info may be null
        super.put("Provider.id name", String.valueOf(name));
        super.put("Provider.id version", String.valueOf(version));
        super.put("Provider.id info", String.valueOf(info));
        super.put("Provider.id className", this.getClass().getName());
    }
648681
public function postAction(Request $request, User $loggedUser, Portfolio $portfolio, $type)
    {
        $this->checkPortfolioToolAccess($loggedUser, $portfolio);

        $response = new JsonResponse();
        $widgetManager = $this->getWidgetsManager();
        $widgetsConfig = $widgetManager->getWidgetsConfig();
        $data = [];
        $statusCode = Response::HTTP_BAD_REQUEST;

        if (isset($widgetsConfig[$type])) {
            $newWidget = $widgetManager->getNewPortfolioWidget($portfolio, $type);
            $data = $widgetManager->handlePortfolioWidget($newWidget, $request->request->all(), $this->get('kernel')->getEnvironment());
            $event = new PortfolioEditEvent($portfolio);
            $this->get('event_dispatcher')->dispatch('log', $event);
            $statusCode = Response::HTTP_CREATED;
        }

        $response
            ->setData($data)
            ->setStatusCode($statusCode);

        return $response;
    }
991139
function addProviderIcon(providerId) {
  var pElt = $('<i>').addClass('fa ' + providersIcons[providerId])
      .attr('title', providerId)
      .data({
        'toggle': 'tooltip',
        'placement': 'bottom'
      });
  $('.profile-providers').append(pElt);
  pElt.tooltip();
}
699852
void initTable(WidgetType type) {

        IndexedContainer data;
        try {
            data = getContainerForType(type, m_realOnly, (String)m_ouCombo.getValue());
            m_table.updateContainer(data);
            m_tableFilter.setValue("");
        } catch (CmsException e) {
            LOG.error("Can't read principals", e);
        }
    }
275166
def put(self, accountId):
        """"""
        self.reqparse.add_argument('accountName', type=str, required=True)
        self.reqparse.add_argument('accountType', type=str, required=True)
        self.reqparse.add_argument('contacts', type=dict, required=True, action='append')
        self.reqparse.add_argument('enabled', type=int, required=True, choices=(0, 1))
        self.reqparse.add_argument('requiredRoles', type=str, action='append', default=())
        self.reqparse.add_argument('properties', type=dict, required=True)
        args = self.reqparse.parse_args()

        account_class = get_plugin_by_name(PLUGIN_NAMESPACES['accounts'], args['accountType'])
        if not account_class:
            raise InquisitorError('Invalid account type: {}'.format(args['accountType']))

        validate_contacts(args['contacts'])

        if not args['accountName'].strip():
            raise Exception('You must provide an account name')

        if not args['contacts']:
            raise Exception('You must provide at least one contact')

        class_properties = {from_camelcase(key): value for key, value in args['properties'].items()}
        for prop in account_class.class_properties:
            if prop['key'] not in class_properties:
                raise InquisitorError('Missing required property {}'.format(prop))

        account = account_class.get(accountId)
        if account.account_type != args['accountType']:
            raise InquisitorError('You cannot change the type of an account')

        account.account_name = args['accountName']
        account.contacts = args['contacts']
        account.enabled = args['enabled']
        account.required_roles = args['requiredRoles']
        account.update(**args['properties'])
        account.save()

        auditlog(event='account.update', actor=session['user'].username, data=args)

        return self.make_response({'message': 'Object updated', 'account': account.to_json(is_admin=True)})
161627
public function setAccessToken($token, $clientId, $userId, $expiryTimestamp, $scope = null)
    {
        $authTokenDataMapper = $this->getTokenDataMapper(Entity\AccessToken::class);

        $client = $this->getClientDataMapper()->findByUuid($clientId);

        if (! $accessToken = $authTokenDataMapper->findByToken($token)) {
            $accessToken = new Entity\AccessToken(null, $token, $client);
        } else {
            $accessToken->setClient($client);
        }

        if ($userId) {
            $user = $this->getUserDataMapper()->findByUuid($userId);

            if ($user instanceof $this->userClass) {
                $accessToken->setUser($user);
            }
        }

        $expiryDate = is_int($expiryTimestamp) ? new DateTime('@' . $expiryTimestamp) : null;
        $accessToken->setExpiryDate($expiryDate);

        if ($scope) {
            $scopes = $this->getScopeDataMapper()->findScopes(explode(' ', $scope));
            $accessToken->setScopes($scopes);
        }

        $authTokenDataMapper->save($accessToken);
    }
489921
function(userId) {
    var self = this;

    if (userId !== null && typeof userId !== "string")
      throw new Error("setUserId must be called on string or null, not " +
                      typeof userId);

    // Prevent newly-created universal subscriptions from being added to our
    // session; they will be found below when we call startUniversalSubs.
    //
    // (We don't have to worry about named subscriptions, because we only add
    // them when we process a 'sub' message. We are currently processing a
    // 'method' message, and the method did not unblock, because it is illegal
    // to call setUserId after unblock. Thus we cannot be concurrently adding a
    // new named subscription.)
    self._dontStartNewUniversalSubs = true;

    // Prevent current subs from updating our collectionViews and call their
    // stop callbacks. This may yield.
    self._eachSub(function (sub) {
      sub._deactivate();
    });

    // All subs should now be deactivated. Stop sending messages to the client,
    // save the state of the published collections, reset to an empty view, and
    // update the userId.
    self._isSending = false;
    var beforeCVs = self.collectionViews;
    self.collectionViews = {};
    self.userId = userId;

    // Save the old named subs, and reset to having no subscriptions.
    var oldNamedSubs = self._namedSubs;
    self._namedSubs = {};
    self._universalSubs = [];

    _.each(oldNamedSubs, function (sub, subscriptionId) {
      self._namedSubs[subscriptionId] = sub._recreate();
      // nb: if the handler throws or calls this.error(), it will in fact
      // immediately send its 'nosub'. This is OK, though.
      self._namedSubs[subscriptionId]._runHandler();
    });

    // Allow newly-created universal subs to be started on our connection in
    // parallel with the ones we're spinning up here, and spin up universal
    // subs.
    self._dontStartNewUniversalSubs = false;
    self.startUniversalSubs();

    // Start sending messages again, beginning with the diff from the previous
    // state of the world to the current state. No yields are allowed during
    // this diff, so that other changes cannot interleave.
    Meteor._noYieldsAllowed(function () {
      self._isSending = true;
      self._diffCollectionViews(beforeCVs);
      if (!_.isEmpty(self._pendingReady)) {
        self.sendReady(self._pendingReady);
        self._pendingReady = [];
      }
    });
  }
672519
function widget( $args, $instance ) {

		global $post; // setup_postdata() needs this

		// Available widgets
		$widgets = ChurchThemeFrameworkWidgets::widgetList();

		// Get template filename
		$template_file = $widgets[$this->id_base]['template_file'];

		// Check if template exists
		$template_path = CTFW_WIDGETS_WIDGET_TEMPLATE_DIR . '/' . $template_file;

		// Sanitize widget instance (field values) before loading template
		$instance = $this->ctc_sanitize( $instance );

		// Make instance available to other methods used by template (e.g. get_posts())
		$this->ctc_instance = $instance;

		if( file_exists( $template_path ) ){
			include $template_path;
		}


	}
702763
function (userId, providerName, providerUserId, cb) {

            var identity = this.$.dataSource.createEntity(Identity);

            identity.set({
                userId: userId,
                provider: providerName,
                providerUserId: providerUserId
            });

            identity.save(null, cb);
        }
134654
public function createWidgetRegisterSession(array $allowedTypes = null, $recipient = null, $backupCodeIdentifier = null, $totpIdentifier = null, $issuer = null)
    {
        $widgetRegisterSession = $this->createEmptyWidgetRegisterSession();

        if ($allowedTypes !== null) {
            $widgetRegisterSession->setAllowedTypes($allowedTypes);
        }

        if ($recipient !== null) {
            $widgetRegisterSession->setRecipient($recipient);
        }
        if ($backupCodeIdentifier !== null) {
            $widgetRegisterSession->setBackupCodeIdentifier($backupCodeIdentifier);
        }

        if ($totpIdentifier !== null) {
            $widgetRegisterSession->setTotpIdentifier($totpIdentifier);
        }

        if ($issuer !== null) {
            $widgetRegisterSession->setIssuer($issuer);
        }

        return $widgetRegisterSession;
    }
865423
public function init()
    {
        $view = Yii::$app->getView();
        if ($this->popupMode) {
            AuthChoiceAsset::register($view);
            if (empty($this->clientOptions)) {
                $options = '';
            } else {
                $options = Json::htmlEncode($this->clientOptions);
            }
            $view->registerJs("jQuery('#" . $this->getId() . "').authchoice({$options});");
        } else {
            AuthChoiceStyleAsset::register($view);
        }
        $this->options['id'] = $this->getId();
        echo Html::beginTag('div', $this->options);
    }
902049
function (token, deviceId, userId, appData, events) {
    appData.acl = {
      ownerId: userId
    };
    var options = {
      app: appData
    };

    require('./helpers').startAppPublish(options, events);

  }
1033215
function(userId, properties, callback) {
      if (!userId) return callback(new Error(utils.i18n.identities.id));
      utils.debug('Identity edit: ' + userId);

      request.patch({
        path: '/users/' + userId + '/identity',
        body: Object.keys(properties).map(function(propertyName) {
          return {
            operation: 'set',
            property: propertyName,
            value: properties[propertyName]
          };
        })
      }, callback || utils.nop);
    }
981875
def put(self, data, request, id):
        
        if not id:
            # can't update the whole container
            raise errors.MethodNotAllowed()
        userdata = self._dict_to_model(data)
        userdata.pk = id
        try:
            userdata.save(force_update=True)
        except DatabaseError:
            # can't udpate non-existing user
            raise errors.NotFound()
1140037
public function init() {

        /**
         * if no id is specified by the user
         * assign a generated one
         */
        if(!isset($this->htmlOptions['id'])){
            $this->htmlOptions['id'] = ($this->id)? $this->id : $this->getId();
        }

        /**
         * if no URL is specified by the user
         * than we assign the default route URL
         */
        if (!$this->url) {
            $this->url = Url::to('', TRUE);
        }

        /**
         * Register this asset with a View
         */
        ShareAsset::register($this->getView());
    }