예제 #1
0
    def do(self, args=[]):
        completed = SiteCreateCommand.do(self,args)
        if not completed:

            if not self.ask_create_name(self.get_next_arg(args)):
                #self.ask_alias_name()
                self.ask_dev_name()
                self.update_client_info()
                self.ask_create_access()
                self.ask_create_mysql(mandatory=True)
                self.ask_allow_override(default='All')
                self.conf.mod('php','enabled', True)
                self.conf.mod('php','php_engine','on')
                mysql_enabled = self.conf.get('mysql','schema') is not None
                self.conf.mod('mysql','enabled', mysql_enabled)
                self.conf.mod('wordpress','enabled', True)
                self.conf.mod('wikimedia','enabled', False)
                self.conf.mod('typo3','enabled', False)
                self.save()
                self.fix_config(overwrite=True)
                try:
                    if inputs.get_input_yesno(t("Do you want to send configuration of %(name)s to %(mail)s?") %
                                                {   'name': self.conf.get('main','site_name'), 
                                                    'mail': CONF_MAP('mail','admin_mail'),
                                                }):
                        self.send_status_mail()
                except Exception:
                    L.exception(t("Problem sending mail in %s") % __file__)
                print self.gen_status_msg()
                completed = True

        return completed
예제 #2
0
파일: site.py 프로젝트: pylanglois/uwsa
 def output_config(self):
     try:
         if inputs.get_input_yesno(t("Do you want to send configuration of %(name)s to %(mail)s?") %
                                     {   'name': self.conf.get('main','site_name'), 
                                         'mail': CONF_MAP('mail','admin_mail'),
                                     }):
             self.send_status_mail()
     except Exception:
         L.exception(t("Problem sending mail in %s") % __file__)
     print self.gen_status_msg()
예제 #3
0
            and unix.is_notunix_user(pam_user)
            and CONF_MAP("ldap", "enabled")
            and CONF_MAP("centrify", "pam_allow_workaround")
        ):
            is_allowed_to_login = False
            with open("/etc/centrifydc/groups.allow", "r") as f:
                for group in f:
                    group = group.strip()
                    if group:
                        print pam_user, group, ldap.is_member_of(pam_user, group, "")
                        is_allowed_to_login |= ldap.is_member_of(pam_user, group, "")
            if not is_allowed_to_login:
                L.error(t("%s is not allowed here! Bye!") % pam_user)
                exit(1)

        if not is_admin:
            cmd_list = [
                "mkdir -p /home/%(user)s" % {"user": pam_user},
                "chown root:%(user)s /home/%(user)s" % {"user": pam_user},
                "chmod g+rx /home/%(user)s" % {"user": pam_user},
                "run-parts --report  %s" % CONF_MAP("libpam_script", "auto_mount_dir"),
            ]

            completed, pinfo = core.exec_cmd_list(cmd_list)
            # if not completed:
            #    L.error(t("Chrooting is NOT working! %s") % pinfo)
        else:
            print t("Hi!")
    except Exception as e:
        L.exception(t("Critical problem in %s") % __file__)