diff --git a/application/clicommands/AutocompleteCommand.php b/application/clicommands/AutocompleteCommand.php index 045110af7..34e4005d5 100644 --- a/application/clicommands/AutocompleteCommand.php +++ b/application/clicommands/AutocompleteCommand.php @@ -1,5 +1,5 @@ -L -B ', version='%%prog %s' % __version__) - - parser.add_option("-d", "--directory", action="append", type="string", dest="dir", - help="Directory, multiple switches possible") - - parser.add_option("-L", "--license", action="store", type="string", dest="license", - help="Path to license file") - - parser.add_option("-B", "--backup", action="store", type="string", dest="backup", - help="Backup suffix, e.g. '.BAK'") - add_optparse_logging_options(parser) - return parser - - -def match_file_suffix(file_name): - """Test if er have configuration for this file""" - global __SUFFIX_MATCHER - if __SUFFIX_MATCHER == None: - keys = FILE_TYPE_CONFIG.keys() - match = r'\.(' + '|'.join(keys) + r')$' - __SUFFIX_MATCHER = re.compile(match) - return __SUFFIX_MATCHER.search(file_name) - - -def load_files(dirs): - """Load all files found into an array""" - filelist = [] - for directory in dirs: - for root, subFolders, files in os.walk(directory): - for file_name in files: - if match_file_suffix(file_name): - filelist.append(os.path.join(root, file_name)) - return filelist - -def count_regex_matches(pattern, string): - """Counting regex matchings, e.g. tokens in a file""" - total = 0 - start = 0 - while True: - match_object = pattern.search(string, start) - if match_object is None: - return total - total += 1 - - start = match_object.start() + 1 - -def test_license_token(data, file_name): - """Test if we have a valid license token in a file""" - global SECTION_MARKER - c = count_regex_matches(SECTION_MARKER, data) - log = logging.getLogger(__name__) - - if c == 2: - return True - elif c == 0: - log.warn('No license token in file %s', file_name) - elif c < 2: - log.error('Incomplete license token in file %s', file_name) - else: - log.error('More that one license token in file %s', file_name) - - return False - -def get_license(type): - """Creates license data for a specific configuration""" - global FILE_TYPE_CONFIG - global LICENSE_DATA - global REPLACE_TOKENS - global __LICENSE_STORE - - try: - return __LICENSE_STORE[type] - except(KeyError): - if not LICENSE_DATA: - __LICENSE_STORE[type] = '' - return '' - config = FILE_TYPE_CONFIG[type] - license_data = [] - license_data.extend([''] * config['linesBefore']) - if config['firstComment'] != None: - license_data.append(config['firstComment']) - for line in LICENSE_DATA.split('\n'): - if line: - license_data.append(config['prefix'] + line) - else: - # Whitespace is uselses in this case (#4603) - license_data.append(config['prefix'].rstrip()) - if config['lastComment'] != None: - license_data.append(config['lastComment']) - license_data.extend([''] * config['linesAfter']) - __LICENSE_STORE[type] = '\n'.join(license_data) - __LICENSE_STORE[type] = __LICENSE_STORE[type] % REPLACE_TOKENS - - return __LICENSE_STORE[type] - -def read_file_content(file_name): - """Read file into a string""" - fhandle = open(file_name, 'r') - content = fhandle.read() - fhandle.close - return content - -def write_file_content(file_name, content): - """Write a string into a file""" - fhandle = open(file_name, 'w') - fhandle.write(content) - fhandle.close() - -def replace_text(org_data, license_data): - """Replace the license token in the string""" - shandle = StringIO(org_data) - out = '' - test = False - - while True: - line = shandle.readline() - - if line == '': - break - - if SECTION_MARKER.search(line) and test == False: - test = True - elif SECTION_MARKER.search(line) and test == True: - test = False - if license_data: - out += license_data - out += '\n' - elif test == True: - continue - - out += line - shandle.close() - return out - -def process_files(files, backup): - """Iterate over files and trigger reokacement""" - global FILE_TYPE_CONFIG - log = logging.getLogger(__name__) - for file_name in files: - data = read_file_content(file_name) - if test_license_token(data, file_name): - base, ext = os.path.splitext(file_name) - ext = ext[1:] - try: - config = FILE_TYPE_CONFIG[ext] - - license_data = get_license(ext) - new_data = replace_text(data, license_data) - - if data != new_data: - log.info('File changed: %s', file_name) - - if backup: - newfile = file_name + backup - log.info('Backup %s to %s', file_name, newfile) - shutil.copy(file_name, newfile) - - write_file_content(file_name, new_data) - - log.info('Written to file: %s', file_name) - - except (KeyError): - log.error('No header config for file type %s', ext) - continue - - - - -def main(): - """Main script entry point""" - global LICENSE_DATA - - parser = init_optparse() - (options, args) = parser.parse_args() - log = init_logging(options.logging_level) - - if options.dir is None or not len(options.dir) or not options.license: - log.error('--dir and --license are mandatory') - parser.print_help() - return (1) - - log.debug('starting') - - LICENSE_DATA = read_file_content(options.license) - - log.info('Scanning directories ...') - files = load_files(options.dir) - log.info('Got %d matching ones', len(files)) - - log.info('Processing files ...') - process_files(files, options.backup) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/etc/schema/mysql-upgrades/2.0.0beta3-2.0.0rc1.sql b/etc/schema/mysql-upgrades/2.0.0beta3-2.0.0rc1.sql index 630dc6d57..e9d4f86a3 100644 --- a/etc/schema/mysql-upgrades/2.0.0beta3-2.0.0rc1.sql +++ b/etc/schema/mysql-upgrades/2.0.0beta3-2.0.0rc1.sql @@ -1,4 +1,4 @@ -# Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ +# Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ DROP TABLE `icingaweb_group_membership`; DROP TABLE `icingaweb_group`; diff --git a/etc/schema/mysql.schema.sql b/etc/schema/mysql.schema.sql index 5f22aead3..c124374ea 100644 --- a/etc/schema/mysql.schema.sql +++ b/etc/schema/mysql.schema.sql @@ -1,4 +1,4 @@ -# Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ +# Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ CREATE TABLE `icingaweb_group`( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, diff --git a/etc/schema/pgsql-upgrades/2.0.0beta3-2.0.0rc1.sql b/etc/schema/pgsql-upgrades/2.0.0beta3-2.0.0rc1.sql index ba6d3b149..7b5b57553 100644 --- a/etc/schema/pgsql-upgrades/2.0.0beta3-2.0.0rc1.sql +++ b/etc/schema/pgsql-upgrades/2.0.0beta3-2.0.0rc1.sql @@ -1,4 +1,4 @@ -/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ DROP TABLE "icingaweb_group_membership"; DROP TABLE "icingaweb_group"; diff --git a/etc/schema/pgsql.schema.sql b/etc/schema/pgsql.schema.sql index 56117d4f8..ae92725fa 100644 --- a/etc/schema/pgsql.schema.sql +++ b/etc/schema/pgsql.schema.sql @@ -1,4 +1,4 @@ -/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ CREATE OR REPLACE FUNCTION unix_timestamp(timestamp with time zone) RETURNS bigint AS ' SELECT EXTRACT(EPOCH FROM $1)::bigint AS result diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 2df4e83e3..c14f58884 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -1,5 +1,5 @@ .control-group { padding: 0; diff --git a/public/css/icinga/dev.less b/public/css/icinga/dev.less index f4af5426a..a1e34be8c 100644 --- a/public/css/icinga/dev.less +++ b/public/css/icinga/dev.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ #fontsize-calc { display: none; diff --git a/public/css/icinga/forms.less b/public/css/icinga/forms.less index 9c7a638ba..8298de13a 100644 --- a/public/css/icinga/forms.less +++ b/public/css/icinga/forms.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ input:not([type]), input[type=text], diff --git a/public/css/icinga/grid.less b/public/css/icinga/grid.less index 0c94c1a2b..76ad0855f 100644 --- a/public/css/icinga/grid.less +++ b/public/css/icinga/grid.less @@ -1,3 +1,5 @@ +/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ + .grid { .clearfix(); } diff --git a/public/css/icinga/layout-structure.less b/public/css/icinga/layout-structure.less index 60903b403..8950ef324 100644 --- a/public/css/icinga/layout-structure.less +++ b/public/css/icinga/layout-structure.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ html { font-family: 'default-layout'; diff --git a/public/css/icinga/layout.less b/public/css/icinga/layout.less index d4f4c8cba..ca606c642 100644 --- a/public/css/icinga/layout.less +++ b/public/css/icinga/layout.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ #footer { bottom: 0; diff --git a/public/css/icinga/login.less b/public/css/icinga/login.less index 13f50f7ca..9c9a28a98 100644 --- a/public/css/icinga/login.less +++ b/public/css/icinga/login.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */ // Login page styles diff --git a/public/css/icinga/main.less b/public/css/icinga/main.less index 0a07d7eef..dd85f2b73 100644 --- a/public/css/icinga/main.less +++ b/public/css/icinga/main.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ // Width for the name column--th--of name-value-table @name-value-table-name-width: 14em; diff --git a/public/css/icinga/menu.less b/public/css/icinga/menu.less index 1968d8d04..61e3e0bb9 100644 --- a/public/css/icinga/menu.less +++ b/public/css/icinga/menu.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ #menu [class^="icon-"], #menu [class*=" icon-"] { diff --git a/public/css/icinga/mixins.less b/public/css/icinga/mixins.less index ced12ac16..1ab28033d 100644 --- a/public/css/icinga/mixins.less +++ b/public/css/icinga/mixins.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ .box-shadow(@x: 0.2em; @y: 0.2em; @blur: 0.2em; @spread: 0; @color: rgba(83, 83, 83, 0.25)) { -webkit-box-shadow: @arguments; diff --git a/public/css/icinga/nav.less b/public/css/icinga/nav.less index 68982c711..8a862f2e3 100644 --- a/public/css/icinga/nav.less +++ b/public/css/icinga/nav.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ .badge-nav-item { > a { diff --git a/public/css/icinga/print.less b/public/css/icinga/print.less index 2e86f09b1..43c79d62d 100644 --- a/public/css/icinga/print.less +++ b/public/css/icinga/print.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ // Print styles diff --git a/public/css/icinga/responsive.less b/public/css/icinga/responsive.less index 2fa6f6c2a..7c759c1ec 100644 --- a/public/css/icinga/responsive.less +++ b/public/css/icinga/responsive.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */ // Not growing larger than 3840px at 1em=16px right now @media screen and (min-width: 240em) { diff --git a/public/css/icinga/setup.less b/public/css/icinga/setup.less index ae849bc90..fa5a327ef 100644 --- a/public/css/icinga/setup.less +++ b/public/css/icinga/setup.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ #layout { overflow: auto; // TODO: Shouldn't be necessary, here, IMHO diff --git a/public/css/icinga/spinner.less b/public/css/icinga/spinner.less index 0bf2f152d..29d3763db 100644 --- a/public/css/icinga/spinner.less +++ b/public/css/icinga/spinner.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ .refresh-container-control > i:before { margin: 0; diff --git a/public/css/icinga/tabs.less b/public/css/icinga/tabs.less index bc0ab87ec..104ed7f45 100644 --- a/public/css/icinga/tabs.less +++ b/public/css/icinga/tabs.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ // Styles for tab navigation of containers diff --git a/public/css/icinga/widgets.less b/public/css/icinga/widgets.less index cd1e479d8..55257e89d 100644 --- a/public/css/icinga/widgets.less +++ b/public/css/icinga/widgets.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ table.historycolorgrid { font-size: 1.5em; diff --git a/public/css/pdf/pdfprint.less b/public/css/pdf/pdfprint.less index 7f6c15e4e..39c3985b9 100644 --- a/public/css/pdf/pdfprint.less +++ b/public/css/pdf/pdfprint.less @@ -1,4 +1,4 @@ -/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ .controls form, .controls .pagination, diff --git a/public/css/themes/Winter.less b/public/css/themes/Winter.less index cd8529608..46d96aa51 100644 --- a/public/css/themes/Winter.less +++ b/public/css/themes/Winter.less @@ -1,3 +1,5 @@ +/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ + @icinga-blue: #001E5b; #icinga-logo { diff --git a/public/css/themes/high-contrast.less b/public/css/themes/high-contrast.less index 898ea00c4..299e1cce5 100644 --- a/public/css/themes/high-contrast.less +++ b/public/css/themes/high-contrast.less @@ -1,3 +1,5 @@ +/*! Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */ + @icinga-blue: #006D8C; @color-ok: #006400; diff --git a/public/index.php b/public/index.php index 3040f0589..39a789158 100644 --- a/public/index.php +++ b/public/index.php @@ -1,4 +1,4 @@