def slot_newpw(self, arg):
     if not self.connect():
         return
     pw = getPassword()
     if pw:
         try:
             self.dbm.setPassword(self.dbuser, pw)
             message(_("Password changed"))
         except:
             message(_("Couldn't change password"))
     self.disconnect()
Example #2
0
def setupCDB(db):
    """Initialization of the database tables for the control panel.
    This need only be run once.
    """
    # Create the main administrator account (owner of the Zeugs
    # databases)
    message(_("The administrative user '%s' will now be created."
              " Please enter a difficult-to-guess password") % ADMIN)
    pw = getPassword()
    if not pw: raise NameError
    db.createMainAdmin(pw)

    # Create the table of databases
    t = u"databases"
    db.send(u"DROP TABLE IF EXISTS %s" % t)
    assert db.createTable(t, (u"id", u"name", u"finalized", u"users"))
    # Grant privileges
    db.send(u"""GRANT ALL PRIVILEGES ON TABLE %s
            TO %s WITH GRANT OPTION""" % (t, ADMIN))

    # Create 'role model' for normal users
    db.createGroupRole(USERROLE)
Example #3
0
def setupCDB(db):
    """Initialization of the database tables for the control panel.
    This need only be run once.
    """
    # Create the main administrator account (owner of the Zeugs
    # databases)
    message(
        _("The administrative user '%s' will now be created."
          " Please enter a difficult-to-guess password") % ADMIN)
    pw = getPassword()
    if not pw: raise NameError
    db.createMainAdmin(pw)

    # Create the table of databases
    t = u"databases"
    db.send(u"DROP TABLE IF EXISTS %s" % t)
    assert db.createTable(t, (u"id", u"name", u"finalized", u"users"))
    # Grant privileges
    db.send(u"""GRANT ALL PRIVILEGES ON TABLE %s
            TO %s WITH GRANT OPTION""" % (t, ADMIN))

    # Create 'role model' for normal users
    db.createGroupRole(USERROLE)