def form_pageForm(self, data): f = form.Form() f.addField( 'pdc', form.Boolean(), label="PDC", description="Should this server act as a primary domain controller" ) f.addField('proxy', form.Boolean(), label="Proxy Authentication", description= "Should this server require authentication for the proxy?") f.addField('cf', form.Boolean(), label="Content Filter", description="Should content filtering be enabled?") f.addField('dhcp', form.Boolean(), label="DHCP", description="Should the DHCP service be enabled?") f.data = {'pdc': True, 'proxy': False, 'cf': True, 'dhcp': True} f.addAction(self.next) return f
def form_pageForm(self, data): f = form.Form() lans = [] for k, n in self.enamel.setup['nets'].items(): if n == "LAN": lans.append(k) cnt = 0 for l in lans: f.addField(l, form.String(), label="%s IP" % l, description= "IP address (CIDR format v.w.x.y/z) or blank for DHCP") f.addField(l + 'dhcp', form.Boolean(), label="%s DHCP Server" % l, description="Enable DHCP server on ths interface") if cnt == 0: f.data[l + 'dhcp'] = True cnt += 1 f.addAction(self.next) return f
def form_pageForm(self, data): f = form.Form() f.addField('rootpw', form.String(required=True), form.CheckedPassword,label = "Root Password", description = "Enter a root password for the installation") f.addField('adminpw', form.String(required=True), form.CheckedPassword, label = "Administrator Password", description = "Enter a password for the administrator account") f.addField('thusam', form.Boolean(), label = "Thusa Managed", description = "Tick this option to grant THUSA (http://thusa.net) permission to provide remote management and support services to this Vulani server. " + "If you have purchased a maintenance or remote support agreement from THUSA, you must tick this box.") f.addAction(self.next) return f
def gotServerGroups(server): servers = [(i[0], i[1]) for i in server] vlics.addField( 'sidlink', form.Integer(required=True), form.widgetFactory(form.SelectChoice, options=servers), label="SID Link", description= "The entry we have created - this will bond the server to the ordering group" ) vlics.addField('completed', form.Boolean(), label="Complete", description="Tick to complete the order. ") vlics.addAction(self.vlicOrder) return vlics
def form_vlic(self, data): vlics = form.Form() vlics.addField('name', form.String(required=True), label="Client Name", description="Where this server will be installed") vlics.addField( 'host', form.String(), label="Hostname", description="The external hostname this server will be reachable on" ) vlics.addField('support', form.String(required=True), form.widgetFactory(form.SelectChoice, options=( ('none', 'No support'), ('standard', 'Standard update protection'), ('silver', 'Silver SLA'), ('gold', 'Gold SLA'), ('platinum', 'Platinum SLA'), )), description="Select a support option") vlics.addField( 'terms', form.Boolean(required=True), label="Accept Terms and Conditions", description=[ "Please read and accept the ", tags. a(href= "http://www.vulani.net/sites/default/files/downloads/T&C.pdf" )["Terms and Conditions"] ]) vlics.addAction(self.vlicOrder) return vlics
def renderForm(user): self.user = user domains = ['asd.co.za'] username = self.user[3] domain = self.user[2] u_form = formal.Form( self.submitForm )[formal.Group('userSettings')[tags.div(_class="field")[ tags.label[self.text.userFormLabelEmailAddress], tags.div(id="emailAd", _class="inputs")["%s@%s" % (username, domain)]], formal.Field('uid', formal.String( required=True), label=self.text. userFormLabelUsername), formal.Field('givenName', formal.String( required=True), label=self.text. userFormLabelName), formal.Field('sn', formal.String(), label=self.text. userFormLabelSurname), formal.Field('userPassword', formal.String(), formal.CheckedPassword, label=self.text. userFormLabelPass), ], formal.Group('mailSettings') [formal.Field('mailForwardingAddress0', formal.String(), label=self.text.userFormLabelForward), formal. Field('mailForwardingAddress1', formal.String(), label=""), formal. Field('mailForwardingAddress2', formal.String(), label=""), formal. Field('mailForwardingAddress3', formal.String(), label=""), formal. Field('mailForwardingAddress4', formal.String(), label=""), formal. Field('mailForwardingAddress5', formal.String(), label=""), formal. Field('mailForwardingAddress6', formal.String(), label=""), formal. Field('mailForwardingAddress7', formal.String(), label=""), formal. Field('mailForwardingAddress8', formal.String(), label=""), formal. Field('mailForwardingAddress9', formal.String(), label=""), tags.div( _class="userLine")[tags.a(href="#", onclick="addForward();") [self.text.userFormLabelAddline]], formal.Field('mailAlternateAddress0', formal.String(), label=self.text.userFormLabelAlias), formal.Field('mailAlternateAddress1', formal.String(), label="" ), formal.Field('mailAlternateAddress2', formal.String(), label="" ), formal.Field('mailAlternateAddress3', formal.String(), label="" ), formal.Field('mailAlternateAddress4', formal.String(), label="" ), formal.Field('mailAlternateAddress5', formal.String(), label="" ), formal.Field('mailAlternateAddress6', formal.String(), label="" ), formal.Field('mailAlternateAddress7', formal.String(), label="" ), formal.Field('mailAlternateAddress8', formal.String(), label="" ), formal.Field('mailAlternateAddress9', formal.String(), label="" ), tags.div( _class="userLine")[tags.a(href="#", onclick="addAlias();")[ self.text.userFormLabelAddline]], formal.Field('vacen', formal.Boolean(), label=self.text.userFormLabelVacationActive, description=self.text.userFormTextVacationNote), formal.Field('vacation', formal.String(), formal.TextArea, label=self.text.userFormLabelVacation), ], formal.Group('userPermissions') [formal.Field('employeeType', formal.Boolean(), label=self.text.userFormLabelWeb), formal.Field('accountStatus', formal.Boolean(), label=self.text.userFormLabelEmail), formal.Field('tumsAdmin', formal.Boolean(), label=self.text.userFormLabelAdmin), formal.Field( 'tumsUser', formal.Sequence(formal.String()), formal.widgetFactory(formal.CheckboxMultiChoice, [(i, i) for i in domains])), formal.Field('tumsReports', formal.Boolean(), label=self.text.userFormLabelReports), # formal.Field('copyto', formal.String(), label = self.text.userFormLabelCopy, # description = self.text.userFormTextCopy) ], # formal.Group('userAccess')[ # formal.Field('vpnEnabled', formal.Boolean(), label = self.text.userFormLabelVPN, # description = self.text.userFormTextVPN), # formal.Field('ftpEnabled', formal.Boolean(), label = self.text.userFormLabelFTP, # description = self.text.userFormTextFTP), # formal.Field('ftpGlobal', formal.Boolean(), label = self.text.userFormLabelGlobalFTP, # description = self.text.userFormTextGlobal) # ] ] u_form.addAction(self.submitForm) u_form.data['userSettings.uid'] = self.user[3] u_form.data['userSettings.givenName'] = self.user[4] u_form.data['userSettings.sn'] = self.user[5] u_form.data['userPermissions.employeeType'] = "squid" in self.user[ 9] u_form.data['userPermissions.tumsUser'] = [] u_form.data[ 'userPermissions.accountStatus'] = "active" in self.user[10] u_form.data[ 'userPermissions.tumsAdmin'] = "tumsAdmin" in self.user[9] u_form.data['userPermissions.tumsReports'] = "Repor" in self.user[ 9] u_form.data['mailSettings.vacen'] = self.user[20] == 1 u_form.data['mailSettings.vacation'] = self.user[19] return u_form