~psiphon-inc/psiphon/trunk

« back to all changes in this revision

Viewing changes to trunk/mod_psiphon/mod_psiphon_auth/mod_psiphon_auth.c

  • Committer: Vlad
  • Date: 2018-09-21 19:10:52 UTC
  • Revision ID: vlad-20180921191052-ixb2qhbkgpkpsowp
added PROVIDER environment variable, added stat.active_users script

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        // not they are redirected to auth.php which drops through
77
77
        // to term agreement after user authentication
78
78
        ap_dbd_prepare (parms->server,
79
 
            "SELECT user.id, user.grp, user.xml_html, proxy.login_url "
 
79
            "SELECT user.id, user.grp, user.xml_html, proxy.login_url, proxy.provider "
80
80
            "FROM user JOIN proxy WHERE user.session IS NOT NULL "
81
81
            "AND user.session = %s "
82
82
            "AND !user.locked "
98
98
    if(dconf->check_remote_hostname)
99
99
    {
100
100
        ap_dbd_prepare (parms->server,
101
 
            "select login_url from proxy where hostname = %s",
 
101
            "select login_url, provider from proxy where hostname = %s",
102
102
            "select_loginurl");
103
103
    }
104
104
    return NULL;
227
227
    struct_pa_dir_config *dconf;
228
228
    const char *url_prefix;
229
229
    const char *proxy_login_url = NULL;
 
230
    const char *provider = NULL;
230
231
    const char *check_hostname;
231
232
    const char *psi_session;
232
233
 
339
340
            gid = atoi(apr_dbd_get_entry(dbd->driver, row, 1));
340
341
            xml_html = atoi(apr_dbd_get_entry(dbd->driver, row, 2));
341
342
            proxy_login_url = apr_dbd_get_entry(dbd->driver, row, 3);
 
343
            provider = apr_dbd_get_entry(dbd->driver, row, 4);
342
344
 
343
345
            /* we can't break out here or row won't get cleaned up */
344
346
        }
349
351
            apr_table_setn(r->subprocess_env, "psiphon_uid", apr_psprintf(r->pool, "%d", uid));
350
352
            apr_table_setn(r->subprocess_env, "psiphon_gid", apr_psprintf(r->pool, "%d", gid));
351
353
            apr_table_setn(r->subprocess_env, "psiphon_login_url", proxy_login_url);
 
354
            apr_table_setn(r->subprocess_env, "psiphon_provider", provider);
352
355
            if (!xml_html)
353
356
            {
354
357
                apr_table_set(r->subprocess_env, "psiphon_remove_mod_transform", "1");
431
434
            proxy_login_url = apr_dbd_get_entry(dbd->driver, row, 0);
432
435
            pa_log("pa_check_user(): proxy_login_url == %s", proxy_login_url);
433
436
 
 
437
            provider = apr_dbd_get_entry(dbd->driver, row, 1);
 
438
            apr_table_setn(r->subprocess_env, "psiphon_provider", provider);
434
439
        }
435
440
        
436
441
        if(!r->unparsed_uri || !*r->unparsed_uri)