Exemple #1
0
class ICover(Interface):

    title = schema.TextLine(
        title=_(u"Title"),
        required=True,
    )

    description = schema.Text(
        title=_(u"Description"),
        required=False,
    )
Exemple #2
0
    def handleCancel(self, action):

        request = self.request
        response = request.response
        response.redirect('/@@setupPassword')
        message = _(u"Cancel this action!")
        api.portal.show_message(message=message, request=request, type='info')
        return
Exemple #3
0
    def handleCancel(self, action):

        request = self.request
        response = request.response
        response.redirect('/@@setupPassword')
        message = _(u"Cancel this action!")
        api.portal.show_message(message=message, request=request, type='info')
        return
Exemple #4
0
class IAd(Interface):

    title = schema.TextLine(
        title=_(u"Title"),
        description=_("Advertising, show at sidebar in homepage."),
        required=True,
    )

    url = schema.URI(
        title=_(u"URL Address"),
        required=True,
    )

    image = NamedBlobImage(
        title=_(u"Image"),
        required=True,
    )
Exemple #5
0
class SetupPassword(form.SchemaForm):

    schema = ISetupPassword
    ignoreContext = True

    label = _(u"Setup Password")
    description = _(u"Please input account id and password, setup it.")

    @button.buttonAndHandler(_(u'Setup'))
    def handleApply(self, action):
        request = self.request
        response = request.response
        data, errors = self.extractData()
        if errors:
            self.status = self.formErrorsMessage
            return

        accountId = self.request.form['form.widgets.accountId']
        newPassword = self.request.form['form.widgets.newPassword']
        user = api.user.get(username=accountId)
        if user:
            user.setSecurityProfile(password=newPassword)
            message = _(u"Already setup password!")
            mType = 'info'
        else:
            message = _(u"User not found!")
            mType = 'warning'

        response.redirect('/@@setupPassword')
        api.portal.show_message(message=message, request=request, type=mType)
        return

    @button.buttonAndHandler(_(u"Cancel"))
    def handleCancel(self, action):

        request = self.request
        response = request.response
        response.redirect('/@@setupPassword')
        message = _(u"Cancel this action!")
        api.portal.show_message(message=message, request=request, type='info')
        return
Exemple #6
0
    def handleApply(self, action):
        request = self.request
        response = request.response
        data, errors = self.extractData()
        if errors:
            self.status = self.formErrorsMessage
            return

        accountId = self.request.form['form.widgets.accountId']
        newPassword = self.request.form['form.widgets.newPassword']
        user = api.user.get(username=accountId)
        if user:
            user.setSecurityProfile(password=newPassword)
            message = _(u"Already setup password!")
            mType = 'info'
        else:
            message = _(u"User not found!")
            mType = 'warning'
    
        response.redirect('/@@setupPassword')
        api.portal.show_message(message=message, request=request, type=mType)
        return
Exemple #7
0
    def handleApply(self, action):
        request = self.request
        response = request.response
        data, errors = self.extractData()
        if errors:
            self.status = self.formErrorsMessage
            return

        accountId = self.request.form['form.widgets.accountId']
        newPassword = self.request.form['form.widgets.newPassword']
        user = api.user.get(username=accountId)
        if user:
            user.setSecurityProfile(password=newPassword)
            message = _(u"Already setup password!")
            mType = 'info'
        else:
            message = _(u"User not found!")
            mType = 'warning'

        response.redirect('/@@setupPassword')
        api.portal.show_message(message=message, request=request, type=mType)
        return
Exemple #8
0
class IPubDep(model.Schema):

    pubdep = schema.TextLine(
            title=_(u"Published Department"),
            required=True,
        )
Exemple #9
0
class ISetupPassword(form.Schema):

    accountId = schema.TextLine(title=_(u"Account Id"), )

    newPassword = schema.TextLine(title=_(u"New Password"), )