nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.26k stars 3.95k forks source link

[Bug]: unable to change login title via themes/../defaults.php #46172

Open mrAceT opened 3 weeks ago

mrAceT commented 3 weeks ago

⚠️ This issue respects the following points: ⚠️

Bug description

I am working creating a different theme for a client, using the same NexCloud instance.

All is going nicely, but I can't get the name altered visible in the Login-screen.. I've got all the rest!

Is it a bug or did I miss a variable?

Steps to reproduce

  1. create a custom theme
  2. and alter all the possible titles
  3. still no title change in the login screen

Expected behavior

A way to change that title also via defaults.php

Installation method

None

Nextcloud Server version

27

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

image

I've set all these "title options" I could find.. and all are changed.. except this one!

This is my defaults.php:

class OC_Theme {

    /**
     * Returns the base URL
     * @return string URL
     */
    public function getBaseUrl() {
        return 'https://alt.url;
    }

    /**
     * Returns the documentation URL
     * @return string URL
     */
    public function getDocBaseUrl() {
        return 'https://alt.url';
    }

    /**
     * Returns the title
     * @return string title
     */
    public function getTitle() {
        return 'alt title';
    }

    /**
     * Returns the short name of the software
     * @return string title
     */
    public function getName() {
        return 'alt title';
    }

    /**
     * Returns the short name of the software containing HTML strings
     * @return string title
     */
    public function getHTMLName() {
        return 'alt title';
    }

    /**
     * Returns entity (e.g. company name) - used for footer, copyright
     * @return string entity name
     */
    public function getEntity() {
        return 'alt title';
    }

    /**
     * Returns slogan
     * @return string slogan
     */
    public function getSlogan() {
        return 'alt slogan!';
    }

    /**
     * Returns short version of the footer
     * @return string short footer
     */
    public function getShortFooter() {
        $footer = '© ' . date('Y') . ' <a href="' . $this->getBaseUrl() . '" target="_blank">' . $this->getEntity() . '</a>' .
            '<br/>' . $this->getSlogan();

        return $footer;
    }

    /**
     * Returns long version of the footer
     * @return string long footer
     */
    public function getLongFooter() {
        $footer = '© ' . date('Y') . ' <a href="' . $this->getBaseUrl() . '" target="_blank">' . $this->getEntity() . '</a>' .
            '<br/>' . $this->getSlogan();

        return $footer;
    }

    /**
     * Generate a documentation link for a given key
     * @return string documentation link
     */
    public function buildDocLinkToKey($key) {
        return $this->getDocBaseUrl() . '/server/15/go.php?to=' . $key;
    }

    /**
     * Returns mail header color
     * @return string
     */
    public function getColorPrimary() {
        return '#87593D';
    }

    /**
     * Returns variables to overload defaults from core/css/variables.scss
     * @return array
     */
    public function getScssVariables() {
        return [
            'color-primary' => '#87593D',
            'color-primary-light' => '#C69F89',
      'image-background'=> '/themes/../core/img/alt.bg.img',
        ];
    }
}
kesselb commented 3 weeks ago

https://github.com/nextcloud/server/blob/d2249148e7231497598b0a6b99233477aa14ac9e/core/src/components/login/LoginForm.vue#L185

I expect the name should be used there but haven't tested it.

mrAceT commented 3 weeks ago

I expect there to be some more logic in het part below where the slogan is shown.. that part goes as expected.. (?)

That gets altered via 'public function getSlogan'

kesselb commented 3 weeks ago

The assignment to OC.theme.name is done here:

https://github.com/nextcloud/server/blob/00aa8f543841c6bfd853a3ac5cb4ff3ab0a058ae/lib/private/Template/JSConfigHelper.php#L242

A starting point for you could be to inspect OC.theme in your browser's console and see if that has the right value.

mrAceT commented 3 weeks ago

There it gets a bit messy? OC.theme.slogan has the 'standard slogan' I've set in the main config (log in as admin and change/set the values in the web-admin-panel)

But the slogan I see in the theme-login is the one set via 'public function getSlogan'