see mod_dav.h for docco */
| 2105 | |
| 2106 | /* see mod_dav.h for docco */ |
| 2107 | DAV_DECLARE(dav_error *) dav_auto_checkin( |
| 2108 | request_rec *r, |
| 2109 | dav_resource *resource, |
| 2110 | int undo, |
| 2111 | int unlock, |
| 2112 | dav_auto_version_info *av_info) |
| 2113 | { |
| 2114 | const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r); |
| 2115 | dav_error *err = NULL; |
| 2116 | dav_auto_version auto_version; |
| 2117 | |
| 2118 | /* If no versioning provider, this is a no-op */ |
| 2119 | if (vsn_hooks == NULL) |
| 2120 | return NULL; |
| 2121 | |
| 2122 | /* If undoing auto-checkouts, then do uncheckouts */ |
| 2123 | if (undo) { |
| 2124 | if (resource != NULL) { |
| 2125 | if (av_info->resource_checkedout) { |
| 2126 | if ((err = (*vsn_hooks->uncheckout)(resource)) != NULL) { |
| 2127 | return dav_push_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0, |
| 2128 | apr_psprintf(r->pool, |
| 2129 | "Unable to undo auto-checkout " |
| 2130 | "of resource %s.", |
| 2131 | ap_escape_html(r->pool, resource->uri)), |
| 2132 | err); |
| 2133 | } |
| 2134 | } |
| 2135 | |
| 2136 | if (av_info->resource_versioned) { |
| 2137 | dav_response *response; |
| 2138 | |
| 2139 | /* ### should we do anything with the response? */ |
| 2140 | if ((err = (*resource->hooks->remove_resource)(resource, |
| 2141 | &response)) != NULL) { |
| 2142 | return dav_push_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0, |
| 2143 | apr_psprintf(r->pool, |
| 2144 | "Unable to undo auto-version-control " |
| 2145 | "of resource %s.", |
| 2146 | ap_escape_html(r->pool, resource->uri)), |
| 2147 | err); |
| 2148 | } |
| 2149 | } |
| 2150 | } |
| 2151 | |
| 2152 | if (av_info->parent_resource != NULL && av_info->parent_checkedout) { |
| 2153 | if ((err = (*vsn_hooks->uncheckout)(av_info->parent_resource)) != NULL) { |
| 2154 | return dav_push_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0, |
| 2155 | apr_psprintf(r->pool, |
| 2156 | "Unable to undo auto-checkout " |
| 2157 | "of parent collection %s.", |
| 2158 | ap_escape_html(r->pool, av_info->parent_resource->uri)), |
| 2159 | err); |
| 2160 | } |
| 2161 | } |
| 2162 | |
| 2163 | return NULL; |
| 2164 | } |
no test coverage detected