File: nss-pgsql-apache.sql

package info (click to toggle)
fusionforge 5.3.2%2B20141104-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 60,472 kB
  • sloc: php: 271,846; sql: 36,817; python: 14,575; perl: 6,406; sh: 5,980; xml: 4,294; pascal: 1,411; makefile: 911; cpp: 52; awk: 27
file content (22 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- This view solves the problem of apache user not being able to access private repositories under
-- nss-pgsql.
-- You MUST replace the markers with your apache user name & user ID

CREATE OR REPLACE VIEW "public"."nss_usergroups" (
    uid,
    gid,
    user_id,
    group_id,
    user_name)
AS
SELECT users.unix_uid AS uid, groups.unix_gid AS gid, users.user_id,
    groups.group_id, users.user_name
FROM users, groups, user_group
WHERE (((((users.user_id = user_group.user_id) AND (groups.group_id =
    user_group.group_id)) AND (groups.status = 'A'::bpchar)) AND (users.status
    = 'A'::bpchar)) AND ((user_group.cvs_flags = 0) OR (user_group.cvs_flags = 1)))
UNION
SELECT (INSERT APACHE USER ID HERE!!) AS uid, groups.unix_gid AS gid, NULL::"unknown" AS user_id,
    NULL::"unknown" AS group_id, '(INSERT APACHE USER NAME HERE!!)' AS user_name
FROM groups
WHERE ((groups.enable_anonscm = 0) OR (groups.is_public = 0));