~donadigo/switchboard-plug-parental-controls/fix-home-config

« back to all changes in this revision

Viewing changes to src/daemon/ProcessWatcher.vala

  • Committer: Adam Bieńkowski
  • Date: 2016-09-10 22:16:01 UTC
  • Revision ID: donadigos159@gmail.com-20160910221601-drq54i6j5gfzwnr7
Fix home config being not created because the user was never logged in

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        }
43
43
 
44
44
        private void handle_pid (int pid) {
45
 
            if (config == null) {
 
45
            if (config == null || !config.get_active ()) {
46
46
                return;
47
47
            }
48
48
 
86
86
                        try {
87
87
                            var unix_user = (Polkit.UnixUser)Polkit.UnixUser.new_for_name (config.username);
88
88
                            var result = authority.check_authorization_sync (Polkit.UnixProcess.new_for_owner (client_pid, 0, unix_user.get_uid ()),
89
 
                                                                            Vars.PARENTAL_CONTROLS_ACTION_ID,
 
89
                                                                            Constants.PARENTAL_CONTROLS_ACTION_ID,
90
90
                                                                            null,
91
91
                                                                            Polkit.CheckAuthorizationFlags.NONE);
92
92
                            if (result.get_is_authorized ()) {
100
100
                        server.disconnect (signal_id);
101
101
                    });
102
102
 
103
 
                    server.app_authorize (config.username, executable, Vars.PARENTAL_CONTROLS_ACTION_ID);
 
103
                    server.app_authorize (config.username, executable, Constants.PARENTAL_CONTROLS_ACTION_ID);
104
104
                } else {
105
105
                    server.show_app_unavailable (executable);
106
106
                }