Commit Graph

166 Commits

Author SHA1 Message Date
Vaida Plankyte 52046d537a auth.py: Add config_error page for misconfigured github/google auth.
Significantly modified by tabbott to use a better system, pass tests,
and clean up the content.
2017-08-16 10:05:19 -07:00
neiljp (Neil Pilgrim) 52ed997d23 mypy: Reorder and annotate variables around if statements. 2017-08-15 17:50:18 -07:00
Jack Zhang a533ab5881 context_processors.py: Add flag for whether user is logged in. 2017-08-15 12:15:21 -07:00
Jack Zhang b82bdc82bf context_processors.py: Add flag for whether page is help center.
This is needed once the header markup is deduplicated.
2017-08-15 12:15:21 -07:00
Brock Whittaker 36f6da9ebf /register/: Hide sign up on invite-only realms.
This hides the right-hand sign up form for realms that are
invite-only, and shows some text that states the realm is invite-only.
2017-07-27 16:53:57 -07:00
Rishi Gupta a26703109e settings: Change all uses of ZULIP_ADMINISTRATOR to FromAddress.SUPPORT.
Make it less likely that further development will break compatibility with
ZULIP_ADMINISTRATORs of the form "name <email>".

Note that the suggested value for this setting has been
'zulip-admin@example.com' for a while, so hopefully this commit causes no
change for most installations.
2017-07-05 15:33:01 -07:00
Rishi Gupta 81220e050b context_processors: Remove zulip_admin from zulip_default_context.
There is no real distinction between zulip_admin and support_email in the
codebase, so fold them into a single variable.
2017-06-29 11:20:32 -07:00
Tim Abbott ec6abddc38 portico: Remove obsolete code for Zulip open sourcing announcement.
This was only ever used on the old zulip.com.
2017-06-06 11:36:03 -07:00
Greg Price 4165c9a62e apps: Link directly to the upstream /apps page.
Now that this page redirects to upstream, make our own links
to it point directly upstream.  This saves a redirect, and
makes it more transparent where the link points if the user
examines it before following.
2017-06-06 11:21:20 -07:00
Tim Abbott 1549f8773e portico: Always display org info when a server has only 1 realm.
Previously, we were incorrectly using the get_unique_open_realm
function to determine whether we're in the (common) single-realm
server case and should just display an org-info-enabled login form on
the homepage.

Now, we use a slightly different function extracted from
get_unique_open_realm that doesn't check whether the realm is
invite-only.

Fixes #4841.
2017-06-02 15:00:22 -07:00
Tim Abbott 847f469cf2 subdomains: Toggle various links with SUBDOMAINS_HOMEPAGE. 2017-05-15 21:54:35 -07:00
Tim Abbott 6eada74bfe portico: Fix exception if no realm description is set.
This was caught via Casper tests, which I regret not running.
2017-05-11 14:23:46 -07:00
Tim Abbott 223624be25 settings: Add support for longer, markdown-powered realm descriptions.
This makes it possible to create much prettier login pages.

Further work on styling may be necessary.
2017-05-11 13:59:46 -07:00
Tim Abbott a3ddd94aa3 integrations: Remove unnecessary email_integration_enabled.
Previously, we were ending up with 2 copies of the email integration
in there.
2017-05-10 11:24:25 -07:00
Tim Abbott dad183093a context_processors: Clean up logic for fetching realm. 2017-05-03 16:39:31 -07:00
Rohitt Vashishtha 47eb19331d ux: Display error on login/registration if no auth backends are enabled.
Also makes a small tweak to CSS to ensure the styling is consistent on
the two pages.

Fixes #4525.
2017-05-01 17:17:37 -07:00
Tim Abbott 84008b9c37 context_processors: Rename confusingly named add_settings context.
Also document this.
2017-05-01 15:47:58 -07:00
Tim Abbott 3fa6bdf49c login: On single-realm servers, assume the only open realm.
This makes it possible to display the nice new login/registration
banner on single-realm servers, which is the common case.
2017-04-26 18:04:05 -07:00
Brock Whittaker 7afbc9ddd6 Redesign login and registration pages.
This completes a major redesign of the Zulip login and registration
pages, making them look much more slick and modern.

Major features include:
* Display of the realm name, description and icon on the login page
  and registration pages in the subdomains case.
* Much slicker looking buttons and input fields.
* A new overall style for the exterior of these portico pages.
2017-04-26 18:04:05 -07:00
Tim Abbott 1fe8df10f0 context: Include realm name, icon, and description.
This will be used in our upcoming login/registration page redesign.
2017-04-17 22:15:51 -07:00
K.Kanakhin 4891a8d850 Add default response for `terms` and `privacy` endpoints.
- Add setting for `privacy policy` template defining.
- Configure default templates for `privacy policy` and
  `terms of service` pages.
- Add route for privacy page.
- Remove condition for showing `privacy` and `terms` pages.
- Add `privacy_policy` setting to context processor.
- Add documentaion part for `privacy` and `terms` templates
  configuration.
- Add tests.

Fixes #3686.
2017-04-12 14:09:14 -07:00
Tim Abbott 6d452e87a5 context_processors: Handle requests without user set.
If `render()` is called from middleware that runs before the
authentication middleware, then this code path will be called with a
request object where request.user is not yet set.  Handle this by
providing a reasonable error message.
2017-03-21 10:06:39 -07:00
James Wang 405f07454c Add server version to about page template.
zserver/context_processors.py: Pull in ZULIP_VERSION variable from version.py
about.html: Put server version into template.

Fixes: #3907
2017-03-09 22:10:54 -08:00
Tim Abbott 9cc83f87fc lint: Clean up E241 PEP-8 rule. 2017-01-23 21:21:14 -08:00
Bojidar Marinov 786dd0fca4 auth: Make min password length and strength configurable.
This adds some configuration options to settings.py, namely
PASSWORD_MIN_LENGTH and PASSWORD_MIN_QUALITY, which control
when the frontend validator invalidates the password.

Closes #2628
2017-01-10 04:55:41 -08:00
Rishi Gupta 2b0a7fd0ba Rename models.get_realm_by_string_id to get_realm.
Finishes the refactoring started in c1bbd8d. The goal of the refactoring is
to change the argument to get_realm from a Realm.domain to a
Realm.string_id. The steps were

* Add a new function, get_realm_by_string_id.

* Change all calls to get_realm to use get_realm_by_string_id instead.

* Remove get_realm.

* (This commit) Rename get_realm_by_string_id to get_realm.

Part of a larger migration to remove the Realm.domain field entirely.
2017-01-04 17:12:23 -08:00
Umair Khan f208813ea3 Add Find My Team feature. 2017-01-03 21:33:42 -08:00
paxapy ff1e97603d context_processors: use a common context for emails.
Fixes #1611.
2016-11-08 11:37:16 -08:00
paxapy 8c7ed80281 context_processors: refactor add_settings realm code.
The new code is substantially clearer and ensures realm_uri is always
set reasonably.
2016-11-08 11:37:16 -08:00
umkay 21c024fc29 auth: Make supported authentication backends a bitfield on realm.
This makes it possible to configure only certain authentication
methods to be enabled on a per-realm basis.

Note that the authentication_methods_dict function (which checks what
backends are supported on the realm) requires an in function import
due to a circular dependency.
2016-11-06 16:16:24 -08:00
Tim Abbott 0f4bbc8617 portico: Add options to disable login and about links.
This gives us a great deal more flexibility for controlling the
context of the portico footer.
2016-09-13 22:59:09 -07:00
Tim Abbott 7950d3181e zmirror: Fix hardcoding of zulip.com support email address.
We now use support_email == settings.ZULIP_ADMINISTRATOR just like
every other support email address reference.
2016-08-18 18:36:07 -07:00
Tim Abbott 4fbb8c3eee templates: Add new context variables to all templates.
This adds a few new helpful context variables that we can use to
compute URLs in all of our templates:
* external_uri_scheme: http(s)://
* server_uri: The base URL for the server's canonical name
* realm_uri: The base URL for the user's realm

This is preparatory work for making realm_uri != server_uri when we
add support for subdomains.
2016-08-13 16:27:35 -07:00
Umair Khan fdbd132ba4 Annotate zerver/context_processors.py. 2016-08-08 15:15:29 -07:00
Tim Abbott 5f275c9868 Re-enable mobile app advertisements in /apps.html. 2016-08-02 16:45:11 -07:00
Tim Abbott 51672f9ddc Remove now-unused zulip_com template context variable. 2016-07-29 20:47:42 -07:00
acrefoot e568dbc76f Add TERMS_OF_SERVICE setting.
This new setting allows the server administrator to add a custom
Terms of Service page by supplying the path to a markdown file.

Also adds a test.
2016-07-29 20:47:31 -07:00
Umair Khan 80d62de40a Add GitHub authentication.
Fixes: #1042
2016-07-29 12:49:10 -07:00
Tim Abbott 82f78621dd settings: Extract CUSTOM_LOGO_URL. 2016-07-19 15:28:41 -07:00
Tim Abbott de679a23c9 settings: Extract settings.REGISTER_LINK_DISABLED. 2016-07-19 15:28:41 -07:00
Tim Abbott c25b077224 settings: Extract settings.SHOW_OSS_ANNOUNCEMENT. 2016-07-19 15:28:41 -07:00
Vishnu Ks ff66ce780a Mention emails are printed in run-dev.py console.
Fixes: #1046
2016-06-20 11:07:20 -07:00
Vishnu Ks ad1c3894d9 Add interface for creating new realms.
This is controlled by settings.OPEN_REALM_CREATION; if that setting is
off, this feature doesn't do anything.
2016-06-17 16:15:28 -07:00
David Roe 3f7cb34b00 enterprise => voyager
(imported from commit 04be792bb480d5e5db1c91d296d1000cf1682571)
2015-08-21 10:33:35 -07:00
David Roe edf7e732a2 ENTERPRISE => VOYAGER.
(imported from commit 4f8080b9f506a87ca40bef32e39de5218cba916a)
2015-08-21 10:33:35 -07:00
David Roe f79adf830f deployed => production
(imported from commit 2d7b0a7a73b0c84b32634a88af1e0d666139d4ff)
2015-08-21 10:33:35 -07:00
David Roe d702ddb3cf DEPLOYED => PRODUCTION
(imported from commit a7d365c07916c5103fc721c712db94f9af977640)
2015-08-21 10:33:35 -07:00
David Roe dedc83e5dd Switch links on login page to the register page in Dev VM.
(imported from commit 16e285b2d8f3c5124eaef0b20aa1097d4a1934d0)
2015-08-19 22:24:53 -07:00
Tim Abbott 43c7ff64d1 Remove unused FULL_NAVBAR configuration setting.
(imported from commit 47c3be669f7ba44426301a46e3f54054f3e2440b)
2015-08-18 20:17:48 -07:00
David Roe 78f32dcbd8 Fix bug in dev login which showed email/password prompts on logins after the first.
(imported from commit 626684ef1da8feb53aca05c9225ee628156f9810)
2015-08-18 20:17:47 -07:00
David Roe 46e224997e Add a new dev login page for logging in without a password on the dev VM.
(imported from commit ac8f2504771c9907b7e92dc91cec5f7220ce951b)
2015-08-18 20:17:47 -07:00
Zev Benjamin 2c760ae735 Remove mixpanel
(imported from commit 9b6cc58ee9be483db8bf2d2eaaaecabc14f821e4)
2015-02-06 13:59:30 -08:00
Zev Benjamin 2e1d5ffd1c Make password_auth_enabled() take a realm object
This will actually be used in an upcoming commit.

(imported from commit 5d3db685a245899b2523440398f2ed2f0cfec4f4)
2014-04-04 16:51:32 -07:00
Tim Abbott bd68884607 Fix documentation for email gateway on Zulip Enterprise.
(imported from commit 82e706b4e8e82df3044e5fc3df70e46b2183bc56)
2013-12-04 16:39:39 -05:00
Tim Abbott feaf6843de Only document email integration if it is enabled.
(imported from commit d1f13ff30c56f7a2156e8c00621b6b955302ccf0)
2013-12-04 16:35:38 -05:00
Tim Abbott a33eb6f61f Update API documentation to use proper URLs for enterprise.
(imported from commit cbf9fba4b8281e8ce7a6dd2964c921d2ef906559)
2013-12-04 15:10:54 -05:00
Leo Franchi 5fd97e48c3 Show a SSO login page for SSO users that just has a login button
(imported from commit 0004bf8710491f4e2d967b4367b37d57833845ee)
2013-11-14 10:56:07 -05:00
Tim Abbott e64472cd32 Rename enterprise template variable to not_enterprise.
The problem here is that some error-related templates render without
the context managers that we specify, and so we want the handling of
"the context was not set" to default to the enterprise case (because
the enterprise version will work basically fine on !enterprise, but
the opposite is not true because the enterprise distribution doesn't
even have the templates for certain !enterprise pages that may be
linked to).

(imported from commit 7547311d87e048d33221587f44b82fe0ba320ca1)
2013-11-13 20:10:33 -05:00
Kevin Mehall 53520b85e6 Change our login links to go to the SSO login page on SSO sites.
(imported from commit 2bccde3846dafd3373db89f507cf63f394d6d7cf)
2013-11-13 17:54:43 -05:00
Tim Abbott 5293cdebe8 Rename LOCAL_SERVER to ENTERPRISE.
(imported from commit 7edf353eefe6c9e7aac74b7bbc37b923cac1b913)
2013-11-12 15:57:01 -05:00
Kevin Mehall 4a6b7cb20b Disable password change when SSO is the only login option
(imported from commit fd1a14237e2d6ea574331ed178bfc0db5beb18c6)
2013-11-12 10:37:33 -05:00
Leo Franchi 6765ec0795 Use a site-specific Zulip Admin email in django error pages
(imported from commit 2d5415d7cd81befc3051b5de3835c0cd258b6375)
2013-11-04 16:35:50 -05:00
Leo Franchi 8e05f76511 Only enable analytics and dropbox on non-LOCAL_SERVER
(imported from commit 1ba877550b3afde51bec6f344762ea998800c5b6)
2013-10-29 17:33:36 -04:00
Waseem Daher 66f48288b4 Rename LOCALSERVER -> LOCAL_SERVER.
(imported from commit b3abdd10d54d2ad7a9c463af9a291d2e2127707f)
2013-10-25 17:37:06 -04:00
Luke Faraone 70e161db01 Make settings.LOCALSERVER available as `localserver` inside templates
(imported from commit 4f0cfd1f1015061942f603cbc03a253a713a9f83)
2013-10-25 13:31:13 -04:00
Tim Abbott e111a2f9a5 [manual] Rename Django app from zephyr to zerver.
This needs to be deployed to both staging and prod at the same
off-peak time (and the schema migration run).

At the time it is deployed, we need to make a few changes directly in
the database:

(1) UPDATE django_content_type set app_label='zerver' where app_label='zephyr';
(2) UPDATE south_migrationhistory set app_name='zerver' where app_name='zephyr';

(imported from commit eb3fd719571740189514ef0b884738cb30df1320)
2013-08-06 07:39:36 -04:00